Colonoscopies are done with a combination of air and water Each has a distinct purpose.
The air, or sometimes the inert gas Nitrogen, is used to inflate the person's colon so the doctor can see what the inside of your colon looks like. Essentially, your colon is inflated to move the colon walls away from the end of the colonoscope and it gets inflated to be a tube about 2 inches in diameter. Then the doctor can turn the end couple of inches of the ‘scope to look at anything abnormal on the colon wall, like a polyp. The inflation also opens up your colon making it easier to advance the ’scope into you. In fact, in the colonoscopies I've had, not under sedation, the doctor has inflated me and advanced the colonoscope all the way around my colon to my appendix quite swiftly. It only took s couple of minutes. Then, he slowly withdrew the ‘scope, looking at my colon walls on the way out. It’s this colon inflated with air that can cause you to fart during the exam, but especially afterwards. Since your colon was inflated, end to end, air can get trapped and that's why you fart for several hours afterwards.
Water is used for a different reason. Sometimes a patient doesn't fast as ordered or take all the laxatives as directed, or they don't fully work as expected. And, yes, that can happen. As a result, when the doctor looks through the ‘scope, hey see poo. Rather than abandon the exam, the doctor can spray water through the colonoscope and wash out the poo, provided it’s small and soft enough to exit through the ‘scope. BTW, this is why enemas alone are an insufficient prep fora colonoscopy…. they don’t go high enough to wash out your small bowel, so more poo keeps coming down. Poo in your bowel can mask problems.
The water also can be used to wash poo off the camera lens and to wash out bits removed during surgery, for pathology study.
So, both air and water are used during a colonoscopy…. each for different reasons.