When you flush, the tank of water does not emtpy all at once, the water level drops while the flapper is floating on top... once enough water is emptied from the tank, the flapper will seal itself once it drops low enough to do so. The bowl fills because the siphon effect usually begins once enough water is dumped into the bowl when the tank is at about 1/4th full... thus once the siphon effect is complete, the remaining 1/4 is still draining into the bowl to fill it because the flapper has not fully lowered to seal yet. Meanwhile, the hose is running the whole time since the flush until the floating balloon thingy reaches the initial level and turning it off but the refill doesn't begin until the flapper seals itself. Got it?
edit: The siphon effect isn't continuous btw which is why it's able to complete one cycle while the bowl fills with the remaining 1/4 tank of water. You can replicate this as an experiment. I know this because I live in an apartment and the water from my washing machine empties into the toilet bowl. I don't nkow how many gallons of water there is in a washing machine but when it's emptying into the toilet, it siphons for about 5 secs fills and siphons again, it doesn't siphon continuously until the washer dumps it's entire load of water. It's kind of like drinking water, you take gulps, you don't let water run straight down your throat and mid gulp you already have some of the water in your mouth for the next.