One would have thought that, if the bike's going in a dead straight line and the rider isn't leaning, that the locked up back wheel would tend to act like a trailed sea anchor does for a boat....that is, keep the bike in a straight line. BTW, I don't use the front brake at all.
A bike very seldom goes straight ahead. Ride through a puddle of water and then onto a dry surface and look at your tracks. It is two ribbons that continually criss-cross each other. The reason for this is the way you balance on a bike. This gets long-winded but I think it will help you understand.
There are two modes of balance on a bike.
Mode 1: When you do a trackstand or ride very slowly. This is the easy one to understand. You simply balance by shifting your weight over the balance point (which is the two contact patches of your wheels) to the required direction in order to avoid falling the other direction. In other words, if you are falling left, you quickly move your body right in order to upset the balance and start falling right. This is continuous and never static like a vase on your mantelpiece.
Mode 2: Balance whilst riding. Here you balance by steering the contact patch into the direction of the fall. This only works above a critical speed and the critical speed is the point where you need Mode 1 to balance. In Mode 2, if you fall to the left, you steer to the left and the contact patch (balance point) moves underneath you towards the direction of falling and again, upsets the imbalance by making you starting to fall towards the other side, where the story continues - you again steer "under" the lean and correct the lean by inducing a fall to the other side. You can simulate this mode of balancing by balancing a broomstick on your hand. This demonstrates the mode nicely albeit in two dimensions rather than only one, like on the bicycle.
Therefore, you are never riding straight ahead but always falling into the lean. I say never, but technically you are riding straight ahead at the exact point when your centre of gravity is exactly below you. This is a moment of flux though and you always move through it, to the other side.
To bring this back to your question then, your back wheel will overtake you because your bike is always steering. Even if you brake and lose grip in the rear tyre, the bike is still steering to keep you upright. However, as soon as the wheel loses grip, it can't track and makes the sudden sideways flick and causes that weird feeling that someone is overtaking you backwards. Micro seconds later you know that the "someone's" bike looks a lot like yours and milliseconds later you are eating asphalt.
To understand how that happens, do this little experiment. Stand next to your bike on a smooth surface like polished concrete or kitchen vinyl. Walk next to the bike (very big kitchen this) by holding onto the saddle and handlebar. Push sideways on the saddle to try and make the bike skid sideways. You'll see this is very difficult or impossible. Friction is at work and the wheel tracks no matter the side force.
Now pull the rear brake, drag the rear wheel and try the test. Suddenly the bike can move sideways. Sliding friction is now at work and this is much less than static friction. The bike can move sideways as easily as forwards.