They sometimes buy keys using stolen credit cards. When the fraud is found out, the banks will request the money from the developer. They in turn often don’t have a way to lock the fraudulent key, so it remains valid.
The costs for the initial bank transfer, plus the time invested in returning the money to the credit card holder are payed by the developer.
The key reseller has a 100% profit margin, the customer has a valid and cheap game key, and the developer actually lost time and money.
There is a famous experiment , where a person gets 100$, and have to offer an arbitrary percentage of that to a stranger. If the stranger declines, both get nothing.
From the strangers perspective, getting offered even 1$ is a win, but the vast majority rejected anything below 30%