How do I undo this setting on a MacBook?
You've managed to enable VoiceOver! If your sound had been turned on, you'd also hear your computer speaking the words that appear on screen. VoiceOver is OS X's built-in screen reading software for the vision-impaired. It can speak and display lots of information about the elements on screen, including the currently-active text field.

You can disable/enable it with ⌘+F5 (or ⌘+fn+F5 on newer keyboards). This and more accessibility-related settings and keyboard shortcuts can be found in the Universal Access preferences, and the Universal Access section of the Keyboard preferences.




(In Lion, it seems you get an intro dialog when enabling VoiceOver — perhaps this doesn't happen when the computer is locked, or in previous versions of OS X.)