The pancreas has two primary functions:
The pancreas glandular cells release digestive juices into a system of ducts within the pancreas leading to the duodenum. The valve at the exit of the pancreas, called the ampulla of Vater, also controls the flow of bile from the liver (through the common bile duct) and from the pancreas. After eating, hormones in the body cause the pancreas to secrete pancreatic juice, and the Ampulla of Vater relaxes, allowing the flow of pancreatic juice and bile into the duodenum where it mixes with the ingested food breaking it down so it can be absorbed by the intestine.
The pancreas also contains small groups of cells (Islets of Langerhans) which make hormones that help the control of blood sugar levels through the production of several hormones (insulin and glucagon) which help the body use or store the energy that comes from food. The pancreas also makes enzymes that help digest food.