It doesn't just happen – you do it. I've never really considered it in the context of a bicycle, but it's the way to turn a motorcycle at any speed above 5mph or so. You'll hear non-riders say that you steer a motorcycle by leaning... Quite the opposite. You steer a motorcycle by steering away from the turn, which causes the bike to fall into the turn. It's the turn that makes you lean, not vice versa. Motorcycles have way too much inertia to affect their path of travel with body weight.
Thinking about it though, I think I did countersteer in order to drop into bowls while riding vert BMX.
That's interesting. In mountain biking it is taught that must lean the bike to turn properly at speed. Some even go a step further and say lean the bike but not your body. I was pondering the physics of why it works the other day but didn't reach a definite conclusion. I guess it makes sense that you can't muscle a heavy motorcycle to lean over, but you could on a much lighter MTB.
Edit: I should mention in mountain biking you are frequently dealing with a low traction environment, which I think has a large impact on the techniques.
Sure, and you can steer a heavy slow moving motorcycle by leaning. That's also not what people mean when they say you steer a motorcycle by leaning. Just because you can do it (under some conditions) doesn't mean that's how how steer a motorcycle. Especially since most people are under the impression that you lean into the turn, not out of it.
But yeah, hypothetically lower inertia = more ability to steer with weight, obviously.
Can vouch for this. I was very surprised when, after many years of bicycling, I went to motorcycle school and they taught us this principle. It was insanely cool that it worked.
Thinking about it though, I think I did countersteer in order to drop into bowls while riding vert BMX.