Twisting the flush handle pulls a flapper valve from the bottom of the tank so that water can rush into the bowl and flush away the waste. When the water level in the tank drops a float ball, mounted on a long rod, falls with the water level until the tank is emptied. Newer toilets use a similar device which uses a float mechanism that slides up and down on a post mounted to the bottom of the tank. As the float assembly drops it activates a valve which permits water to enter the tank. At the same time the flapper valve which opened during the flush cycle now closes by gravity puling it back into place over the opening in the bottom of the tank.
Water now enters the tank to refill it.
At the same time a small tube attached to the filer valve opening diverts a small amount of water into the overflow tube in the tank. That overflow tube is there to prevent the tank from overfilling if there were a fault in the filler valve. It is connected directly to the bowl side of the flapper valve hole and dumps water back into the bowl. The small tube mentioned above is there to ensure that the toilet bowl is filled completely with water during the tank refilling cycle. If it is removed the bowl may not fill completely with water.