It generates a modulating field that transmits the reflected light from one side of an object to the other, making a person much harder to see. Since it works by adding a bonus to the Sneak skill, it only has an effect while sneaking.
Nightkin NPCs can be seen using Stealth Boys, however, their usage is entirely cosmetic. Unlike the mechanics of traps, one does not have to make a saving throw in order to spot nightkins. However, if the player character uses a Stealth Boy, sneaks and begins a fight in a room with closed doors, enemies from other rooms will not join the fight.
Oddly, no Stealth Boys appear anywhere in Fallout 2. Even nightkin patrols near Mariposa Military Base do not have any remaining devices. However, it can be found in the game's files and can be added with an inventory editor, though attempting to use it may result in the game crashing.
End of information based on Fallout 2 cut content.
The following is based on Van Buren and is not canon.
The device's backstory wasn't developed until Van Buren, the canceled Fallout 3 by Black Isle Studios, where it was spelled as "StealthBoy" to prevent it from being confused with the "Stealth Boy" playing style.