The answer to 'how does P-trap work' is that a P-trap is a curved section of pipe installed under a sink or other plumbing fixture. Its purpose is to create a water seal that prevents sewer gases from entering the home. The 'P' shape of the trap holds a small amount of water, creating a barrier that blocks odors and pests from coming up through the drain.
The water seal is maintained by the natural pull of gravity, which keeps the water in the curved portion of the pipe. When the fixture is used, water flows through the trap and replaces any water that may have evaporated. This continuous water seal is essential for preventing sewer gases from entering the home and ensuring proper drainage.