Lens hoods are primarily intended to prevent unwanted stray light from entering the lens and causing flare. They also provide a degree of protection for the lens from accidental impact and from the elements.
Nikon official product
The Nikon HB-N104 Lens Hood is a bayonet lens hood for the Nikon 1 18.5mm f/1.8 lens. It keeps stray light, lens flaring, and ghosting to a minimum.