Teaching is one of the easier ones. And it's quite easy to account for 'problem' kids in their assessment.
It's never going to be a perfect system, and it is very possible that a 'good' teacher could be let go somewhat unfairly, like in any other business. Those good teachers would find new work and do just fine.
It's much better to let a few good teachers go with the many more bad ones than it is to keep everyone just to make sure the good ones don't get let go.