Hello, Here's a quick review of how the refill mechanism works. There's a big float inside, which is connected to a valve at the end of a water hose. Once you flush, the float will drop and water will flow in to fill the tank. As a result, the float will rise and will gradually increase pressure on the valve. The water flow will now get weaker. It should eventually stop when the float gets to a certain level. So now, after you basically know how it works, I'll mention a couple of reasons which may cause such malfunction.
1.The valve is made out of rubber, it may get worn with time and thus cause water to continue flowing, even if the float is high enough and the tank is full. In such a case an "emergency pipe" will drain the water down to the bowl (a leak).
2.Something may had got caught near the float, keeping it from going all the way up (Maybe even friction between the float and the tank). Water will keep getting in, and a leak will start.