It doesn't always work like this. I once took over a team that had an extraordinarily unprepared developer - of the "tough time with fizzbuzz" variety. He was a nice guy, and I felt bad cutting him loose. My predecessor (who had hired him) didn't understand software development and had no way of giving him the kind of feedback that would have prepared him for this. I don't think the guy was totally surprised, and years later (when I met him randomly at a party) he said he had no hard feelings about the incident. But he sure looked disappointed at the time.
Friend of mine took over a team which had a guy with the opposite problem (though he was a pretty nice guy too). He had the skills to do the job. Indeed, he'd been doing it for three or four years. Then one day he just decided he didn't like software development any more.
Now, a normal person would have gone one of two ways. Either they'd start looking around and find something they thought would be more interesting and then leave for whatever that was, or they'd grit their teeth and keep doing the job they didn't like because they need the paycheck and couldn't find anything that paid enough (guys with families, mostly).
This guy, though, figured the things he liked paid less, so there was no hurry to leave. But he didn't have enough personal integrity to actually do the work while he was still drawing a paycheck. So he just stopped working. He'd show up for work every day and surf the web, listen to ball games, talk on the phone, etc.
It took some time, but eventually my buddy sat him down and said "Look, you need to start actually working instead of just showing up to the office," to which the guy replied "No. You're going to have to fire me".
He made my friend grind through all the paperwork to actually fire him. It's a big company, so it took awhile. They gave him verbal warnings, written warnings, put him on a "performance plan", and eventually he was fired. It took months. He wasn't disappointed or resentful or anything. He just took his couple months of free money and waited around for the paperwork to go through.