The ES-71II Lens Hood from Canon is compatible with the Canon EF 50mm f/1.4 USM Lens and features a black felt interior lining to absorb light and therefore reduce unwanted light reaching the lens. Lens hoods are primarily designed to prevent unwanted stray light from entering the lens by extending and shading the end of the lens. In addition, since the end of the lens is extended, you also get the added benefit of some extra protection from accidental impact.
Dedicated lens hoods are designed to match the specific focal length of the lens it was designed for.