How does a bong work?

Unlike the unfiltered, direct hit of a dry pipe, water pipes and bongs filter smoke through a chamber of water before it travels up the neck to be inhaled.
Upon contact with the water, the smoke is instantly cooled 40-50 degrees to a lower temperature that doesn't hurt the throat. 
Cooling smoke causes it to condense, so by delivering a cooler and more condensed smoke, bongs allow a user to consume both a larger amount of material in one hit, and at a higher frequency throughout the day thanks to the smoother hit. 
Bong have evolved in their styles, shapes, and materials (like borosilicate glass bongs), but the core principals of filtering smoke through water have withstood the test of time. 
More advanced bongs, as mentioned above, use "Percolators" to further diffuse the smoke through water. "Diffusion" is the process of forcing smoke through several tiny holes while submerged under water. This process is done either through a percolator or a diffused downstem. By forcing the smoke through the percolator holes, the large, single stream of smoke is broken up into many tiny bubbles, resulting in more contact with water, and further cools the smoke on its way up. Proper diffusion can bring the smoke down to a comfortable temperature, so you can enjoy numerous hits over and over.