The foregut develops from the endodermal germ layer and forms the pharynx, esophagus, stomach, duodenum, pancreas, liver and biliary system. It undergoes folding and rotation during development. The respiratory system develops from the laryngotracheal diverticulum of the foregut. The foregut derivatives are divided into cranial and caudal portions, with the cranial portion forming structures like the thyroid and parathyroid glands, and the caudal portion forming the esophagus, stomach and pancreas.