Lens hoods are primarily designed to prevent unwanted stray light from entering by extending and shading the end of the lens, ensuring no problems with vignetting or motor functions. Additionally, since the end of the lens is extended, you also get the added benefit of some extra protection from accidental impact. Lens hoods match the specific focal length of the lens it was designed for.