Not exactly: most phones simply allow you to wipe the entire OS and reinstall it, thus wiping all data about any SIM lock. iPhones don't do that.
When you buy a subsidized iPhone, and pay off every monthly payment and then your contract ends, you have effectively bought the phone at full price by that time (if not for much more). It would be fair for the SIM lock to then automatically be released, but that doesn't happen. In fact, it's up to the carrier's discretion whether they let you do it or not, and they usually do not, just because they can. In that case, it would be great if you could just wipe your phone and crack the SIM lock, since you should now legally be able to use any SIM. But iPhones don't let you do that either. You're at the mercy of the carrier, and Apple built iPhones in a way that allows such a situation to persist.
For this reason, you cannot sell an iPhone that you have now fully paid off, to someone in another country or someone wishing to use a different carrier. This significantly reduces the value of the phone you paid full price for (over the months).
They could have built the SIM lock in such a way that it's soft coded, not hard coded.