P-traps replaced the use of s-traps, particularly under sinks, to eliminate the siphoning problem. A p-trap has two main features that stop siphoning.
The first is a vented pipe. A p-trap is vented typically inside a wall and through the roof to the outside air. When air pressures are balanced inside the drain, siphoning becomes far less likely since negative pressure or the “sucking” action needed for siphoning doesn’t occur.
Second, an extension is added to the drain side of the trap. The extended pipe dramatically reduces the possibility of gravity “pulling” water through the pipe. That piece of pipe is called a waste arm extension.
A common calculation used to determine the required length of the waste arm extension is a simple one; the length of the extension needs to be 2-1/2 times the diameter of the pipe in order to eliminate the possibility of siphoning. For example, a 1-1/2″ drain pipe needs a waste arm extension no less than 3-3/4″ long to ensure a proper p-trap configuration.
The water inside a p-trap can still evaporate though. So, there is still no “perfect” configuration that can totally eliminate the possibility of a dry trap.
If you have a sink that is rarely used, a dry trap can happen simply due to evaporation. Regular plumbing maintenance and occasionally running water for a few seconds into the drain can eliminate that possibility.