Irritable bowel syndrome (IBS) is a functional disorder. Even though the digestive tract looks normal, it doesn't always function as it should. Muscles in the intestines move food from the stomach to the rectum. Normally, they contract and relax in a gentle rhythm, which moves the food along in a fairly predictable schedule. But in some people, the intestinal muscles spasm. That means the contractions are longer and stronger than normal. Those spasms are painful. They also disrupt the movement of food through the intestines. If they slow it down, you become constipated. If they speed it up, you get diarrhea. It's not unusual for people with IBS to alternate between the two. Another cause of discomfort for people with IBS results from oversensitive nerve endings in their digestive tracts. Small bubbles of gas that wouldn't bother most people might be quite painful. This heightened sensitivity can also lead to a sense of swelling and bloating.