Let's say you owe a private hospital ten thousand dollars, but you have very few assets, so they're pretty sure they're never getting any of that back. There's ninety nine other people who also each owe the hospital ten thousand dollars. (It doesn't have to be a hospital; any debt can be sold this way.) The hospital has shit to do and the low chances of you paying them mean it's an unnecessary drain on their time and resources to hound you all for it. But they can get *some* money, by selling your debt to a third party.
Let's say the sell each ten thousand dollar debt for ten dollars (I'm making all these numbers up for simplicity). So a third party gives the hospital one thousand dollars, and now all hundred of you owe that third party ten thousand instead! You're in the clear with the hospital, you owe it to these guys now! And their job is to hound and harrass you for the money you owe. If one of you pays up more than a thousand dollars, you've covered their initial investment. These guys are gambling on the likelihood that enough of you can pay your debts that you make it worth the time they spend tracking you and harrassing you.
Or, instead of trying to get the money out of you, they can just... decide you don't owe them. Why not? They own the debt. They can fork out a thousand bucks, buy a million in debt, and forgive it. That's what these guys did. (This is also a favourite move of John Oliver; if you ever see headlines about John Oliver forgiving debt, this is what he's doing). A small payment can take a massive weight off the shoulders of a lot of struggling people.
Again, I made up the numbers to simplify the math. But this is how the process works.