For those in search of flat stomachs, being underweight won't get you there.
Being underweight actually causes one's stomach to stick out.
2 main reasons:
What little fat you have left is preferentially stored in the stomach to protect vital organs, rather than evenly distributed throughout the body. So, stubborn stomach fat will stay on you forever if you stay underweight forever. Fat will re-distribute after weight restoration and your stomach will no longer protrude compared to the rest of your body - ONLY if you FULLY weight restore. If you stay underweight at all or in a pseudo-recovered, almost-there state, the fat will not redistribute. You will have a round stomach that sticks out, forever.
A starving person has wasted away at their muscles, including their core muscles which typically hold in the stomach and make it flatter. You can't do core exercises to flatten up your stomach if you're undernourishing, though (as explained in another article on this site). The only way to regain muscle - including core muscle - is to gain enough weight (which will be mostly fat) first. You can't skip to gaining muscle.
I like how Dr. Jennifer Gaudiani in Sick Enough puts it with a balloon metaphor (emphasis mine):
"...Many people with anorexia nervosa are highly focused on and experience body image distortions around the appearance of their stomach. When patients become underweight or have lost weight very quickly, many have the triggering experience of “seeing” their most recent meal because their stomach sticks out. Their eating disorder brain can interpret this as weight gain and then try to sabotage recovery work. I like to tell the story of the balloon metaphor in this situation.
I tell my patient: Imagine I blow up a balloon and tie it off, and I put it on the table in front of you. If I drape a thin sheet over the balloon, you will see every contour. If I toss a thick horse blanket over it, you might see that something’s there, but it would be less evident.
For the first time in a while, you currently have digesting food, stool, and gas at various stages through your digestive system. These are the metaphorical “air” blowing up the “balloon” of your GI tract. Because you have insufficient fat and muscle, your abdominal wall is lying like a thin sheet over that balloon. Your muscles literally aren’t strong enough anymore to hold in the contents of your abdomen. Therefore, you can see every meal.”
“By contrast, I have a nice horse blanket: plenty of fat and muscle. As a result, pretty much no matter what I eat, my belly looks the same. I encourage you to reframe and understand that only people who are malnourished and underweight can “see their meal.” As you get stronger and more weight restored, this will resolve. For now, understand that this protuberant stomach is a sign of malnutrition, the opposite of what you are fearing."