The pancreas is responsible for producing other digestive enzymes and hormones but insulin production is one of the most important functions. After eating a meal, sugars are absorbed into the bloodstream which elevates the blood sugar levels. This increase is detected by the pancreas which then secrets the appropriate amount of insulin into the bloodstream.
Insulin acts like a 'key' that unlocks a door into a cell so glucose can pass through the cell wall. As the cells take more sugar from the bloodstream, the blood sugar levels return to normal and insulin production slows. Without insulin, the cells would not be able to absorb this energy no matter how much food was consumed.
In people with type 2 diabetes, the body either doesn't produce enough insulin or has problems using it properly. This is what causes diabetes -- an insufficient supply of insulin, or the body's resistance to the effects of insulin, resulting in blood sugar levels which are too high. A diabetes treatment plan (which may or may not include insulin shots) must be followed in order to return blood glucose levels to healthier, near-normal ranges.