Many handlebars have a 31.8mm clamp section, and a common MTB seatpost size is 31.6mm.
I know these are both around 1 1/4 inches. Why the 0.2mm difference though?
Frame tubing is generally standardized by external diameter to imperial dimensions in increments of 1/8 inch, which makes it a lot easier to standardize things like front derailleur clamps. Seat tubes therefore tend to have external diameters of 1 1/8” (28.6 mm), 1 1/4” (31.8) or 1 3/8” (34.9 mm).
Handlebars are similar. Though there has been more variation historically (eg 26.0 and 26.4 mm in addition to the imperial sizes), modern bikes tend to use handlebars with imperial sizes for the clamped diameter.
The problem, however, is that the internal diameter is not standardized, because it depends on the thickness of the tubing wall, which varies quite a bit. High quality lightweight frames can have very thin-walled tubing, while lower quality frames might need thicker walled tubing to get the same strength. So two seat tubes that are both 28.6 outer diameter could have different inner diameters.
Since the seatpost diameter has to closely match the inside diameter of the seat tube, variation in inner diameter of seat tubes has resulted in a large number of different seatpost diameters. Makers of more expensive bikes have largely converged on 27.2 and 31.6, but there are still many others, especially on lower end bikes.
The dimensional differences have to do with purpose of the individual part. The seat post outside diameter has to match the seat-tube inside diameter.If you are asking why they didn't make it .2mm thicker it was a design decision. Based solely on an engineers experience or opinion. It may have been because they wanted a thicker wall on the seat tube or they wanted to lighten the seatpost by a few grams either way the only one that knows for sure was the designer. Why they do it only the manufacturer can say for sure, it may be solely to make the part not interchangeable requiring you to buy parts from a single supplier.
The history behind 31.8mm handle bars is explained in this article (thanks to the OP to have mentioned it in the chat, and Criggie to have found the link). It doesn't explain the difference between handle bars and seat posts though.
The short version is: the original idea was to develop 32mm handle bars, because the standard 25.4mm/1 inch was reaching limits with mountain bikes. But due to shrinkage during the manufacturing of the first batch(es), the final diameter became 31.8mm. Because stem were not manufactured yet, the initial designers decided the keep their first batch of handle bars and adjust the stems.