The pressure switch controls the water pump, turning it on and off automatically as water is drawn. A failed switch causes constant running or no pressure - a typical wear part. Matching switches are available for common 12V pumps.
If the pump runs without water being drawn, or pressure disappears, the switch is usually worn. Replacement takes little effort.