You'd be surprised. Many many firms code via the endless-chain-of-6-month-contracts method. Yeah, eventually the code goes to pieces and needs to be scrapped and rewritten, but that point can be years after the existing management has moved on.
Are Apple, Amazon and Google really just more lucky at hiring?
It could very well be the case. Nothing breeds success like success. The best and brightest apply to Apple, Amazon and Google because that's where all the other best-and-brightest folk are applying. If your company doesn't have that same level of name recognition amongst the programming community, you might have a lot of difficulty raising your applicant pool to the same level.