Lens hoods are primarily designed to avoid 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.
JJC LH-63II replaces Canon Lens Hood EW-63II
l CANON EF 28-105mm f/3.5-4.5 II USM
l CANON EF 28-105mm f/4.0-5.6 USM
l CANON EF 28mm f/1.8 USM