Let’s start with men’s shirts: buttons on the right placket, the open flap on the left. The most common explanation comes from the fact that clothing, for wealthy men, often included weaponry. Since most men held swords in their right hands, this Quora thread explains, “it was more convenient and quicker to use their left hand for unbuttoning.” You can see evidence of that in portraiture. All those hand-in-waistcoat pictures popular in the 19th century? They involve, generally, the slipping of hand into an open area of the coat, right-to-left.
You could also see the right-button orientation as a holdover from warfare more directly. “To insure that an enemy's lance point would not slip between the plates,” curators write in The Art of Chivalry: European Arms and Armor from the Metropolitan Museum of Art, “they overlapped from left to right, since it was standard fighting practice that the left side, protected by the shield, was turned toward the enemy. Thus, men's jackets button left to right even to the present day.”
You can extend the theory even further back (as in, waaaaaay further back). As Katherine Lester puts it in Accessories of Dress, “a man's role as hunter required that he pull a weapon from left to right. Fastening a garment from right to left would impede the movement of our ancestors.” Or, as the menswear-loving comedian Paula Poundstone noted, jokingly taking on the button differential in Salon: “Some costumers speculate that at one time, both men and women held animal skins over themselves with their left hand, making a right-over-left closure, in order to free up their right hand for more important tasks, such as signing their Discover card receipt at the belt store.”
Okay. So that (mostly) explains why men’s buttons are on the right. But then, why are women’s on the left?
One theory: babies. Given right-hand dominance, women tend to hold their infants in their left arms, keeping their right arms relatively free. So shirts whose open flap is on the right, one theory goes, makes it easier for them to open with those free hands for breastfeeding.
Another theory: horses. Women, to the extent women rode horses, rode sidesaddle, to the right—so putting their shirt and dress buttons on the left reduced, to some extent, the breeze that would flow into their shirts as they were trotting along.
Another theory: spite. The early days of industrialization—the time when clothing manufacturing practices were becoming standardized, and coming to set some precedents for today—coincided with the early days of the women’s movement. One theory holds that manufacturers took advantage of little differences in clothing to emphasize bigger differences between the genders. The left-right button differential wasn’t, in that sense, so much a matter of practicality as it was one of philosophy. (For a corollary to that, we can thank, again, Napoleon. That hand-in-waistcoat pose? Women, apparently, used to mock the emperor by mimicking that pose. One theory (which, warning, I can’t find much corroboration for, but I put out there for your consideration) holds that Napoleon ordered women's shirts be buttoned on the opposite side of men’s to end all the fun-making at his expense.