A lot of the time this is because of the Peter Principle.[1] There are ways to combat it, though. A friend a Google explained to me that to get around this there, before being promoted you have to take on the responsibilities of the position you are looking to advance to for a few (or six?) months. Once you've proven that you can do the job passably well, they'll consider you for the promotion.
The idea is that you prevent advancing someone from an engineering role to a managerial role only to find you've lost a good engineer and gained a crappy manager, which is a double blow (ignoring for this example that engineering and managerial tracks are separate at Google AFAIK, and managers actually get paid a bit less at the same level).