Apple's verification is a bit different (and slightly better) than Google's two-factor authentication.
What happens is you will always get two choices after you enter your Apple ID password: you can either send the code by SMS or you can either send a code directly to your device. Yes, Apple can actually send any notification they want to your device, Big Brother style, since Apple owns all of its devices. Nothing to be afraid of this, it just means Apple can use it for cool stuff like two-factor authentication. It will literally send you a notification to any of your devices. The notification will appear on the lock screen, but it will never show the code, it'll simply say something along the lines of "Unlock your iPhone to view the authentication code".
So what Zxxv is suggesting is that you set up the SMS number to be a trusted friend (not that they'll know your Apple ID password anyway). Every time you need to login, a code will be send directly to your iPhone; however, if ever your iPhone is stolen, you will be able to send the code by SMS to your friend's device.
Something I didn't mention: you can set up multiple devices. So if you have an iPad or a MacBook, you can activate those as well. This will mean that every time you login, you will be presented with a list of options and you can choose which device to send it to. If your iPhone is stolen, you can just send the code to your MacBook. If all your devices are stolen, you can send it to your friend's SMS number.
And if your friend's phone is also stolen? Not a problem, because Apple will also ask you to print or write down an auto-generated "recovery key".
The recovery key is the code you will use as a last resort, if all of your devices are not accessible plus your friend's device is not available... it's recommended you keep the recovery key on a piece of paper in your wallet, or written down somewhere in a notebook. It won't be worth anything to anyone if your wallet gets stolen because (a) they still won't know your Apple ID password, and (b) you can login into your account and change the recovery key, which would void the old recovery key forever.
Very important that you store the recovery key physically on a piece of paper... there is no point writing the recovery key down in the Notes app of your iPhone, that defeats the whole point if your iPhone is stolen.
Plus, don't forget that she can always set up multiple devices for her codes, so if her iPhone is stolen, she can simply send the code to her MacBook. That way she would never have to use SMS if she didn't want to.
Yes, good point. The other option would be to turn off message preview on the lock screen, but this would, of course, compromise the convenience of seeing messages from everyone else.