It has to break out of the ball to have a chance of fleeing.
So lets say you have a 99% chance to catch and a 20% flee rate.
If you were to repeat that same throw 500 times against the same pokemon with the same level, you'd expect to catch that pokemon 495 times (0.99 x 500 = 495), and of the 5 times it would break out of the first ball, only 1 of those times it would actually flee (0.2 x 5 = 1).