How does a water pump know when it needs to turn on?
"what's its trigger" it depends on the pump. It can start when it detects a change in pressure when you turn on a faucet or flush the toilet, a sensor will detect this drop in pressure. (look up the Bernoulli's principle) It can also start when it detects water flow. In this case, it is usually not a sensor but a vane that moves from the flowing water.