I was once married to a woman from a military family. Just as we were parting, her father was retiring as a lieutenant general (that's three stars) in the US Army.
The US military prides itself on being "professional", which in the military context means largely immune to the immediate external politics of their country. Examples of non-professional military organizations would be one loyal to a dictator or one in which promotions were largely governed by nepotism. However, that's not to say the US military is not political. To be promoted to 1-star general or above, one must be nominated by the President (on recommendation of a military promotion board) and then confirmed by the Senate. While this is apparently often a smooth process and the President and Senate follow the recommendations of the promotion board, that's not always the case.
In addition, the higher up one rises the fewer positions there are available into which one could be promoted. It's not a matter purely of rank. By tradition, the very uppermost positions are always filled by officers from particular specialties. For example, the head of battle strategy will always be an officer who rose through the ranks of the infantry, not an officer who spent his career in logistics.
Finally, the military has an "up or out" policy. There is a period of time after one's previous promotion when one is eligible for one's next promotion, the specific period depends on the rank. If you are promoted before that time, you are "below the zone", during that time, "in the zone" and beyond that period "above the zone". You only get one shot at "above the zone". If you are not promoted that year (only 3% of officers not promoted in the zone are promoted above the zone), you must retire.
In the case of my former father-in-law, there were only two jobs left for him to take and the then-occupants of those jobs showed no signs of leaving. So he retired because there was nowhere for him to advance in the army (a funny aside - he was quite worried about what kind of civilian job he could get since he only knew the military life, but he immediately got a job as a VP at a large telecommunications company and retired from that job not too many years later as a very wealthy man).
All of this brings me to a subject in the news today: the replacement of Gen. Peter Pace as Chairman of the Joint Chiefs of Staff. Ever since knowing my former father-in-law and watching the end stages of his army career, I always have sympathy for people in Gen. Pace's position. Such a person has spent his whole life playing the game well to rise to that position. It is purely by chance that one would happen to rise to the top position during any particular war, and it seems to me especially bad luck to reach that point in the middle of an especially unsuccessful and wrong-headed war. I can't help but feel sad for the guy.