Riding a lot absolutely helps get better, but there is also such a thing as deliberate practice for uncommon situations. Riding 100000 miles straight is very different from riding 10000 miles in twisty turns, around sharp corners, practicing your emergency-braking, etc. Even if its just 5 minutes or so doing these a week, it makes you a vastly better rider.
Every time I have to take extended time away from riding for some reason, I always immediately start off with a parking lot session of riding around, getting back into the groove. It doesn't take very long for it all to come back with just a bit of deliberate practice.
But there are what we call weekend warriors, and many, especially in the US store away their bike for half the year as well. There are many riders who barely put more than even a couple thousand miles a year on their bikes. And these are some of the most dangerous riders to be around, especially if they have an ego.