It goes back to the fact that most humans are right-handed.
Long before we had modern weapons such as guns and automobiles, people had to do battle using swords and horses. Now if you are right-handed, you wear your sword on the left, so that you can draw it out rapidly with your right hand.
But with that long, dangling scabbard encumbering your left side, the only way you can mount a horse is by throwing your free right leg over him. And unless you are in a Mel Brooks movie and want to wind up sitting backward on your steed, that means that the horse’s head has to be pointing to your left. To this day we still train horses to be saddled and mounted from their left sides.
Now that you are mounted, you will want to stay on the left side as you start down the road, because anyone coming toward you will be on your right, and if that someone turns out to be an enemy, you can whip out your sword with your right hand and be in position to run the scoundrel through. Thus, prudent horsemen have always ridden on the left side of the road.
This left-side convention was also honored by horse-drawn carriages in order to avoid annoying collisions with horse-men. When horseless carriages made their appearance, some countries continued the habit, especially during the overlap period when both kinds of carriages were competing for road space.
So why do people drive on the right in the U.S. and many other countries?
When swords went the way of bows and arrows, the need for defending one’s right flank disappeared and traffic rules were suddenly up for grabs. Younger or less tradition-bound countries migrated to the right, apparently because the right-handed majority feels more comfortable hugging the right side of the road. It quickly occurred to left-handed people that it was unhealthy to argue with them.
Some countries that I’ve been in must have large populations of ambidextrous people, because they seem to prefer the middle of the road.