Actually, the corner flags are used for determining whether the ball went out for a throw-in or a corner kick. If the ball rolled out over the corner of the pitch, there'd be arguments to no end about whether it should be a throw-in or a corner. Every now and then the ball bounces off the corner...