Anatomy of a Toilet
The fill valve brings water into the tank after the toilet is flushed and stays on until the tank refills. Any time water exits the tank (such as when a flapper is leaking), the fill valve will turn on in order to maintain the water level.
The flapper sits on the flush valve and is connected to the tank lever by a chain. When the toilet is flushed, the flapper lifts up off the flush valve seat and allows the water to exit the tank.
When the toilet is flushed, water flows from the tank into the bowl through the flush valve.