I sort of have a personal problem with the constant barrage of comments about being a working screenwriter that involve throwing arbitrary numbers out at people like the above "20 screenplays." I know it was just a number chosen to illustrate, but it's completely false.
If you write one script, it's good, and you have the right luck, you can sell it. That's a lot of what doesn't get talked about, the luck. Yes, your script has to be worth a damn - but the real trick for unknown writers in the film business is getting their script into the hands of someone who likes it and is in a position to do something with it. You can do research and try to up your odds, but with all the assistants and interns that are reading out there, it really comes down to luck.
It's not just quality. And it's certainly not quantity.
Now, odds are you'll be writing a better script when you're on your fifth or fifteenth, but to tell someone they need to have a dozen or twenty scripts under their belt before they try to make it is to ask them to spend years and years at work with no hope of success.
It's not easy, and it does involve an awful lot of luck and a very good script, but let's not put an arbitrary number out there.
As to the reason why it seems like so many terrible scripts get produced, the truth is that you have to be better to get in the club than to stay in the club. A proven writer can be hired to write off of a pitch or can sell a script that wouldn't have made it past the intern if they were an unknown. On top of that, a lot of scripts are rewritten by committees and endless series's of other writers until everyone on the production is basically content with it - which means you have an uninspired but unoffensive piece of tedium no matter how good the script was to begin with. The latter is the biggest problem at the moment - and it's a big reason why independent films (which very often stick with the creator as the only writer) tell more contentious and better stories.
So the answer is that the terrible script that get produced are either sold BECAUSE the writer was a known entity or they were committee-ed into being that bad by a hollywood afraid of taking a chance of alienating any demographic when they're going to spend millions and millions of dollars on the production.
On a final note, the 80,000 mentioned above is accurate, but that's only if you're selling to a WGA signatory. If the company, producer, or whatever you're dealing with isn't a signatory to the guild they can pay you any amount you agree to.