A shower drain is essentially a hole in the bottom of the shower to let water flow out of the basin or tub. The shower drain is covered by a cap, a screen with several small holes or slots for the water to flow through. This allows water to drain out of the tub but still catch much of the hair and other debris that might otherwise clog the drain.
Most showers also have a way to close off the drain if, for example, the user wishes to take a bath. Older shower drains often had a rubber plug that could be pushed into the drain to stop the outflow of water. Newer showers usually have a built-in valve with a toggle that can open or close the shower drain.
If the shower is kept running while the drain is closed, the water will eventually overflow the tub. To prevent this from happening, most showers have an overflow pipe. The overflow is a second pipe that enters the tub above the shower drain but below the rim. If water gets as high as the overflow, it will automatically flow in, thus preventing the tub from overfilling and flooding the room.
The overflow and the normal shower drain are both attached to pipes, which join beneath the tub. The water then flows downward into the trap, a U-shaped section of pipe underneath the tub. When water flows down and then back up through the trap, some water stays behind. This water forms a seal, which prevents sewage gas from bubbling back up through the drains and causing a nauseating stench. After the trap, the water from the drain joins with the sink and toilet lines and flows down into the sewer or septic system.