The answer to 'how does faucet work' is that a faucet is a valve that controls the flow of water from a plumbing system. When you turn the faucet handle, it opens a valve that allows water to flow out of the faucet spout. The faucet handle is connected to a stem that controls the opening and closing of the valve. As you turn the handle, it lifts or lowers the stem, which opens or closes the valve to regulate the water flow.
Faucets come in a variety of styles, materials, and mechanisms, but they all work on this basic principle of using a valve to control the water. The specific internal components may differ, but the overall function is the same - to provide a way for you to turn the water on and off as needed.