The phenomenon you're describing is known as the Venturi effect. It is a fluid dynamic principle that explains why there can be suction when draining a dishwasher or washing machine at the sink/drain hose but not when running them.
When you drain a dishwasher or washing machine, water flows out of the machine through the drain hose and into the sink or a standpipe. As the water flows through the hose, it creates a pressure drop due to the restriction in the hose's diameter or the shape of the drain opening. According to Bernoulli's principle, as the water's speed increases, its pressure decreases.
Now, when the water is running in the dishwasher or washing machine, it is filling up the tub or drum, and the drain hose is typically not full of water. As a result, there is enough air in the hose to allow for proper drainage without significant resistance.
However, when you stop the dishwasher or washing machine and initiate the draining process, the water already in the hose starts to flow out. As the water rushes out, it creates a lower pressure region within the hose. To equalize this pressure, air is drawn into the hose from the sink or the surrounding area, and this creates the suction effect you observe.
The Venturi effect is commonly seen in various plumbing and fluid flow scenarios, and it's essential for allowing proper drainage in appliances like dishwashers and washing machines. The suction during drainage helps prevent backflow and allows the water to flow smoothly from the machine to the drain, keeping the plumbing system functioning efficiently.