The pharynx is a channel for air and for food. It leads into both the larynx for breathing and the esophagus for swallowing.
Food is chewed, lubricated, slightly digested by saliva and moved back by the tongue.
In about a minute the food is formed into small chucks called bolus and swallowed through the pharynx. The epiglottis closes over the larynx preventing food from getting into the trachea resulting in choking. It moves down the esophagus on its way to the stomach. Air passes from the pharynx through the glottis into the trachea during inhalation. During exhalation, air passes from the trachea into the pharynx.