I read that the corset was the 1st woman's undergarment ever that existed before bra and panties. I looked up corsets on google and they just basically looked like one piece underwear. It looks like only one piece underwear existed before the two piece bra and panties. Fun fact: Today, little girls wear ONLY one piece underwear until they're ready to wear a two piece underwear when their breasts start developing and/or when they're a certain age, when they're older they can still wear one piece underwear but by than most girls only wear two piece underwear.
One piece underwear isn't the same as a corset. The main distinguishing aspect is that a corset shapes the torso into a particular shape. Which is why someone like Dita Von Tease has a very tiny waist, because she wore corsets that basically molded her body. Although, these days there are tops referred to as corsets because they share the same look without the function. One piece underwear doesn't mold the body at all.
Alright, so back when women wore corsets, they wouldn't wear underwear (panties). Their skirts were very heavy, and they would wear petticoats too. This was to make it easier for when they went to the bathroom, which was very difficult especially when wearing a crinoline (hoop skirt), which they would usually need a maid to hold up when they went to the bathroom. long, airy underwear was eventually introduced, but there were also crotchless options again to make it easier when going to the bathroom.
A corset is not a one piece underwear garment, and where do you get the idea that little girls wear a one piece? I have never seen a little girl in a one piece and it would make it incredibly difficult for them to go to the toilet. A corset draws in the waist and pushes the bosom up. I imagine it was also used to hold ill fitting clothes together. When they wore corsets they would most probably wear bloomers or long-johns or something similar.