Walk across a carpet, especially during the winter months when the air is especially dry, and you pick up electrons. Electrons are negatively charged particles. Now you have a negative electric charge in your body. Touch a metal faucet, and you're going to get shocked. The faucet is an electrical conductor. The electrons move from you to the faucet. When that happens, you feel the static shock. You may even see a spark, especially if it's dark in the room.
Experts recommend not taking a bath or shower during electrical storms to avoid being electrocuted. In fact, if you touch a metal faucet (as when you wash your hands), you can be shocked as well. The lightning can enter your house through the plumbing. Copper is an excellent conductor of electricity. Even if the water plumbing system is a mixture of plastic and copper, lightning can jump and temporarily electrify a faucet. The only way this can't happen is if all the water pipes are made of plastic.
Another common way you can get shocked from touching a faucet is by holding a faulty appliance at the same time. If you're holding a hair dryer that has an electrical short, for example, or touching a faulty vacuum cleaner and you reach over and touch a metal faucet, you can get shocked. The electricity runs from the hair dryer, through you (human beings are great conductors of electricity) and to the metal faucet.
Plumbing pipes are typically grounded. If the metal pipes in your house aren't grounded and an electrical short develops, you can get shocked when you touch the metal faucet. The short can be a loose electrical wire that's touching a water pipe, for example. The short can be most anywhere that electricity lines and water pipes are in close proximity. As long as a live wire is touching the plumbing system, the electricity can travel along the pipes.