There could be several causes or triggers of IBS, sometimes it can be because of food passing through the gut too fast or too slowly, oversensitive nerves in the gut, it could be stress that triggers it or a family history of IBS or all of these things combined.
One would need to look at each individual, their lifestyle, genetic history, to determine what the causes are.