Designed to prevent stray light from entering the lens in order to keep unwanted glare from affecting your photographs.
Canon Lens: