How do people obtain iphone 5s locked to a carrier? - 1

I'm seeing ads on kijiji and craigslist about people selling "Brand new sealed iphone 5 64 gb locked to Rogers"

Now I'm just wondering how they are obtaining these phones, because I thought iphones could only be obtained through apple, in which you would be buying it unlocked for full price, and then through a carrier, in which you would be buying it for a cheaper price but on a 3 year contract.

Are the ads I'm seeing for phones on a contract (they don't state so, so I'm assuming they're not), or are they somehow getting iphones locked to carriers? How do they get these phones? Where do they buy them from? I just want to make sure it's legitimate.

When you buy the phone from the carrier it is locked to that network.