Q: If not, how do they differ?

Q: And ... can I unlock an iPhone 4 with iOS 5.1.1?

A: Yes, you can use ultrasn0w for a software unlock if your iPhone 4's baseband is 01.59.00. You can check your baseband version by going to Settings->General->About and looking at the Modem Firmware number.