When trying to troubleshoot your toilet, the ballcock is an important component to pay attention to. This valve lives in the toilet tank and is connected to a metal arm, which then connects to a float. The ballcock is gravity-operated and controls the refilling of the toilet tank.
After you flush, the toilet will empty, as will the toilet tank. As the water refills in the toilet bowl, the tank also refills. The ballcock and metal arm it is attached to allow the float to rise with the water. Once the float gets high enough, the mechanism will shut off the ballcock valve, and the toilet is ready to use again.