The solder mask prevents solder from sticking to parts of the board that don't need solder on them.
To add components, solder paste (little balls of metal embedded in a flux) is applied to the areas without solder mask (using a metal plate that is laser cut to have holes where solder is needed), and then an optical/robotic system called a pick and place machine places each component at the right spot. (Or you can do this with tweezers.) Finally, the board is heated to the melting point of the solder, and because of the solder mask, pulls all the components into the exactly right place (by minimizing surface tension, something liquids like to do). Through hole boards are a little different, they get "wave soldered" where the board floats on molten solder and attaches to the metal areas. The solder mask is even more helpful here. If you didn't have solder mask, you'd just get a thick layer of solder on top of every trace, and potentially bridges between adjacent traces, which is bad. (But people do apply solder to exposed traces to increase their current carrying capacity.)
TLDR, the plastic on top is paint that makes manufacturing easier. If you make PCBs in your own shop with a laser or mini CNC, you won't have solder mask, and you can see how much more difficult soldering components is. It's not impossible. Just a little bit more work from your hand and brain is required, and that's expensive at scale. So, plasticy paint.
The natural color of the most common fiberglass used in circuit boards is a straw color - you will see this from time to time, either on very low cost boards or where solder mask has been deliberately left off.
Vias were literally rivets in the very early days of PCB fabrication. Someone might still be selling a kit of that kind of thing for people who etch boards themselves. I'm not going to look, but they were still around 20 years ago, they were obsolete then, and things hang around in this industry for a long time after they're obsolete. Actual through-rivets have very poor mechanical performance and crack easily. Vias and through-holes for parts leads are typically plated now. You can only get plated through holes from the quick-turn suppliers hobbyists use, and that's a good thing.