You seem to misunderstand something. Debt collectors aren't winning cases of illegitimate debt. They are winning legitimate court cases that the defendant simply ignored. Even if you bring a lawyer to court that doesn't mean that you won't have to pay the debt. That $5000 debt was probably bought for less than $500 by the debt collector and the debt collector is willing to settle for something like $1000 which is still significantly less than the original debt.
If people don't know about the debt and it goes to court and a default judgment is issued, well, we don't know if the original debt is real or not because it didn't get tested in the court.