That's a really big question and one on which I'm unqualified to give a thorough answer as I can only answer for my own agency, not the hundreds or thousands of other agencies out there. So I will give you some info on how it works for us, but take this with that caveat in mind.
First of all, it depends on where an officer is in his career. What happens to a probationary staff member versus what happens to a guy 6 months from retirement are going to be different. If an officer is in his probationary year, there is no cause necessary for termination. If a rookie messes up, his response will determine what happens: if he takes the criticism, it's probably a non-event, but if he bucks, he might not be cut out for this line of work. Minor mistake, probably overlooked by supervisors and just addressed by more senior officers. Moderate mistake, dealt with by supervisors (Lieutenants usually, maybe the captain). A severe mistake gets referred straight to the top and usually ends in termination, or as someone referenced earlier in this thread, resignation. We all hate that because it means that they can theoretically come back later, or at least get a job with a different agency.
If it's a guy with a couple of years in, he will get addressed by senior officers for a minor error and maybe even a moderate one. For a serious error, it probably goes to the top again, but this time, more likely for suspension than termination. One guy messed up to the point that I'm not sure how he still has a job and he just got 30 days on the street with no pay. (And while he hasn't messed up like that again, he's still not a great officer.)
For somebody at retirement eligibility, for something severe, he may be told to put in his retirement paperwork. "Dude, you've put in 20+ years, but we can't keep you on with that infraction. You need to go, but we don't want to cheat you out of all that invested time, so just retire rather than get fired."
And I do have to add this: depending on the severity of the offense, if it happens on duty, we can be referred to the Office of Internal Affairs, Office of the Inspector General, or the FBI for prosecution. I have seen that a couple of times and it isn't pretty. (Off-duty stuff is separate and can still be prosecuted, but flows through a different chain, although it can still result in suspension/termination from work.)
As far as performance metrics, I won't go into the details, but I get evaluated quarterly and annually on 5 primary criteria. If I get Outstanding ratings on at least three of them for the year (which is a culmination of the quarterly evals) then I am in line for a pay raise, cash incentive, or additional time off. That motivates a lot of people to perform well and not mess up too badly. (One of the metrics is communication, which, based on the length of these posts, you can probably guess, I usually get an O on that one! lol)