In the United States, the carriers subsidize our phones. In other words, instead of paying the full retail cost of a cell phone, you buy your phone for a lower cost from the carrier, and then you are under contract for a term of typically two years. During that time, your phone is SIM locked to that carrier, so the firmware on the phone actually blocks other carriers' SIM cards from working in that phone.
For example, A Lumia 1520 costs somewhere around $500 unlocked in the US. If I went to at&t today, I could pick up the phone for probably $99 or $199. The rest of the cost of the phone is quietly added into the monthly bill for the phone service. For two years, that phone is locked to my at&t SIM, so I can't switch SIM cards to put that phone onto another cell network.