Performing a factory reset on a phone returns it to its out-of-box state. All your apps and data are wiped clean and you have to go through the setup process again. If a third party reset the phone, the codes that changed the phone from locked to unlocked are removed.