It is a flap or lid like valve tube and protects the wind pipe by arresting the entry of food.

Actually oesophagus is a muscular tube. it's function is to transport food from the pharynx to the stomach. when food is chewed and mixed with saliva then it becomes a blood bolus. then the muscles contract at the top and push the bolus forward this contraction moves forward like a wave, pushing the bolus into the stomach.
The rhythmic, wave-like contraction of the digestive tract that forces food through it this is the process by which food is transported. the process is called peristalis.