Diagram of a bong in operation.
The user holds a flame over the substance to be smoked. As the user inhales, the flame is drawn towards the substance and the smoke travels through a hollow pipe that is attached to the bottom of the bowl containing the smoke-able material. The pipe enters into a vessel containing water. The hole through which this stem passes is airtight, and the bottom of the pipe is submerged in the water.
The smoke rises through the water, cools, and is trapped in the air chamber above the water. At the side of the container [on plastic bongs] above the water level, there is usually a small hole called a "Carb" or other names, which is kept covered up with a finger until the point when sufficient smoke has been held in the air gap. Its purpose is to allow an easy passage of air into the container when the smoke is finally inhaled into the lungs. The fresh air from this hole helps to cool the smoke further.
Some plastic bongs have a "Pull Up Bowl"; they have either glass or metal stems but depending on the company that makes the bong it is either a glass pull out or a pull out metal bowl. Glass bongs almost always have a "Pull Up" or "Pull Out" bowl which has a rubber O-ring to form a seal with the bong stem. The glass bowl is pulled out of the stem after the chamber is full of smoke, allowing clean air to enter the chamber further cooling the smoke and allowing the user to "Clear the bong".
Bongs of more expensive design can sometimes feature ice catchers, which allow ice to be stored in the main chamber where smoke resides. This ice can cool the smoke to below room temperature, sometimes allowing smokers to intake significantly more smoke and hold it in the lungs for a longer duration. More elaborate [and usually more expensive] glass pieces can also contain other features such as: Diffuser Stems, Ash Catchers, and Glass on Glass work on the stem and bowl allowing for even more options such as Activated Carbon Filters.
From Wikipedia