I asaume the tap is closed!!?Surface tension and the shape of the tap will influence this. Next time you are drinking through a straw put your finger over the end and pull the straw out of the drink. You should see that the liquid stays in the straw and this is essentially the same as the tap. The surface tension of the liquid creates a partial vacuum which holds the liquid in place. A different liquid (with a lower surface tension) or a wider straw would allow liquid drip out of the straw or tap.
Well PurplePancakes – I’m assuming the tap is closed; in which case this is down to the valve in the tap. There is constant water pressure pushing on the tap, which goes right back to the source of the water, which could be from a water tower or the water comes from a spring on a hill or mountain. The valve equalises this pressure and holds back the water. If the tap is turned, the valve opens and the pressure is released..and hopefully you don’t get wet!