
This picture post will attempt to show how a P-trap functions, or more importantly what makes them function.

P-traps have for the most part replaced most other kinds of traps—notably the S-trap. The toilet is one notable exception—it is designed to be siphoning—the more siphoning the better. You want to hear that glug glug glug.

Many inspectors are under the false impression that merely lengthening the trap arm will eliminate the S-trap, but what this actually does is increase the potential for siphoning of the trap as the slug of water attempts to go down the drain. It is a similar principle to how a toilet siphons.

The configuration still makes an “S,” just an odd shaped “S“ is all.
What makes the P-trap function is the vent, and the rules that guide where that vent has to be.
Essentially the vent has to be at least two pipe diameters away from the Weir. The Weir is where water either starts to go down the drain after the trap or stops going down the drain. So in a typical 1-1/2″ kitchen sink drain that would be a minimum of 3″ away.

We also have to be careful to not get the vent too far away from the weir as the trap arm could flood and block the vent–essentially returning the assembly to more of an S-trap.
The rules of how far away it can be has to do with the diameter of the pipe (trap arm). The bigger the diameter the longer the weir can “see” the vent.
Charles Buell, real estate inspections in Seattle