On a basic level, plumbing works with the forces of pressure and gravity. Pressure brings water into your home, the water is used, and then gravity sends the wastewater back out of your home. If you really want to understand how it works, you should learn about the supply, fixtures, and drainage of your home plumbing system.
Water Supply - If your home is like most homes, your water main connects to the public supply system. The water passes from the public supply, through a main shut-off valve and a meter, and then into your home. It's good to know where your main shut-off valve is located in case of an emergency. If your valve requires a key (similar to a lug wrench for a car) to operate, you'll want to keep one handy.
If you have a home water filtration system, the water supply splits into indoor and outdoor lines after passing through meter. If not, it simply splits into cold water pipes and hot water pipes (which go to your water heater).
Plumbing Fixtures - Your fixtures are your sinks, toilets, dishwasher, etc. - any outlets through which you use your water and then dispose of the leftover waste. Some of these fixtures will have their own shut off valves (separate from the main valve) that can be used during repairs or emergencies. This way, your loved ones can still shower even if the downstairs sink needs repair.
Drainage - The drainage system is separate from the supply system and is bridged at the fixtures. The drainage begins at each fixture with a trap. If you look under your sink, its trap is the s-curved pipe underneath it. This trap allows the drainage to flow out from the sink, but also leaves a small amount of water in the curve when the faucet is shut off. This water seal blocks any of the gas that might circulate inside the drainage system.
The drain water then passes through a T-pipe. The pipe leading up connects to the roof vent, letting any existing gas safely escape. The pipe leading down connects to a series of other sloping and vertical drainpipes that let the natural force of gravity take the wastewater out of your home. At certain reachable areas of the drainage system, you'll find cap-covered clean outs that provide access to clogged pipes.