Any difference between store bought factory unlock and factory unlocking it yourself?

A relative of mine lives in California and was going to get me an iPhone. He says he was going to buy a used one that is factory unlocked. I noticed, a factory unlocked iPhone is sold pricier than one that is locked. I've also noticed that there are posts on Craigslist that claims that they can factory unlock an iPhone. Is there any difference? Can't you just buy a locked iPhone and just factory unlock it yourself? Or is there glitches and whatnot?

It's a lot easier just to buy it unlocked, then have to have the headache of unlocking yourself.