The causes of colic in babies are not fully understood, but it is believed to result from a combination of factors including gastrointestinal discomfort, an immature digestive system, sensitivity to breast milk or formula, and overstimulation. Possible contributors include gas or indigestion, food allergies or intolerances (such as to cow's milk protein), digestive immaturity, and sometimes early childhood migraines. The crying associated with colic may also be related to an infant's temperament or difficulty adjusting to the outside world. Some studies suggest gut hormones like motilin could play a role by causing increased intestinal motility and abdominal pain. Other factors like exposure to cigarette smoke have also been linked to increased colic risk. Importantly, colic typically resolves on its own by around three to four months of age.