The larynx, like many other body parts, is under hormonal control during development.
Male hormones encourage the growth of the larynx, and the Adam’s apple is the prominence made by the cartilage that creates the housing for the larynx.
The larger male larynx, the longer vocal cords and the bigger box that resonates when the vocal cords are set in vibration combine to make a deeper sound, one of the reasons the male voice is distinct from the female voice.
The hormones of puberty set off the enlargement, so the Adam’s apple can be considered to be one of the secondary sex characteristics, like the beard or mustache.