This all started from a question I saw on a beer brewing video.
People wonder why you when you make beer, you bring the wort to a boil.
The simple reason is is that the malts you're using will extract most of their sugars around 145°-167° Fahrenheit.
Basically, we're mashing the grains. Now, when you mash on the lower end of that spectrum, the malt will extract more fermentable sugars, and the more fermentable sugars, the more alcohol you get when the yeast ferments the sugars. The drawback is that the beer will have less body and mouthfeel.
When you mash on the higher end of that spectrum, you get less fermentable sugars, meaning the less alcohol you get when the yeast ferments the sugars, but the benefit though is that you get a beer with a better body and mouthfeel at the end.
You can also add lactose to any brew to sweeten them without worrying that the yeast will eat them, because lactose is a non-fermentable sugar. Yeast hate it, and won't touch it, and lactose tastes just like any other sugar, so it can add residual sweetness to any brew, beer included. In fact, there's a whole category of beer called Milk Stouts where they add lactose to the beer.
Now the historical reasons of why they boiled beer. These days with our filtered spring waters, we essentially have access to high quality water at the pull of a lever. Back in the day, folks might not have had that, and even when you extract water from a good source like a well or a spring, you still have to boil the water to make sure it won't make you sick.
Not that they didn't have high quality water, but it was considered best practice.
The other historical reason is kinda funny. When you bring water to a boil, you get bubbles. Well, back then, that's how they thought you got carbonation in beer.
These days, we actually know that to get something fizzy, we need to dissolve CO2 into the liquid to make it fizzy. Yeast does this the natural way by fermenting sugar and producing ethanol and CO2 as a result, and you can fine tune the ratio so that it produces more CO2 than ethanol.
Typically this is done after you know for certain the beer is done fermenting. All you do is add sugar, and the residual yeast ferments it, creating the fizz. If you didn't make sure the beer was done fermenting, this can then create bottle bombs, where the glass literally shatters and sometimes explodes due to the pressure of the yeast and CO2, and the seal doesn't allow off gassing to occur.
You can also force pressurize water to force dissolve CO2 into the liquid, and this is how soda manufacturers make their drinks fizzy. If you ever wondered why plastic bottles are common for soda, it's because when carbonating beverages this way, glass can shatter from the pressure.