How does it do that? Its a lock to force people to stick with a provider, and pay through the nose in other ways. Phone plan rates in the US are terrible, restricting peoples ability to change provider through artificial means doesn't provide better rates.
If, 3 months in, you find yourself unhappy with your carrier, you can still pay the remainder of your phone cost ($875) to own your phone outright and walk away. In that time, you’ve saved $75 off the full price of the phone.
Arguing that US carrier prices are exorbitant is not relevant to whether carrier locks and phone discount credits are worthwhile or cost effective.
If you have a line of credit for the cost of a phone, then you have a line of credit for the cost of a phone. If you have a contract for service, them you have a contract for service.
If you try and terminate either then they will reclaim based upon your contract with them.
This would only be a real problem if there were no options to buy phones direct/outright without the lock. Instead, we’re likely to end up in some situation where carriers work with phone manufacturers to implement a sort of higher-level device lock feature that stipulates the device “belongs” to the carrier and can be functionally locked (a la the stolen device lock features that currently exist) if they ever go unpaid.