Closest to the body, you have the base layer that keeps you dry, which consist of 1 or 2 layers depending on weather conditions and your activity. Then a warming layer and finally a shell garment that protects against water and wind.
The multi-layer principle works best with the right material, where wool is good for hiking as it keeps warm when it is damp, as well as it breathes and does not smell bad. Avoid cotton as it absorbs moisture and cools when wet. Fleece is airy and is warmed by your body heat, but does not retain heat itself. Fleece should be air dried instead of washing, as fleece can release microplastics into the washing machine.
First layer
The first layer transports and absorbs moisture as it should ensure that you stay dry. That makes the choice of material in the clothes closest to the body important.
Second layer
The second layer is the one that warms the most and is often what you also regulate the heat with. You put it on during low-intensity activity or while resting, and take it off during greater exertion. In this way, you retain your body heat when you stand still and avoid getting too hot and sweaty while you are moving. Common materials in the third layer are fleece and wool.
Third layer
This is the outer protective layer, and it should primarily provide protection against wind and precipitation. Another important task is that the layer should provide with a functioning ventilation that regulates the heat.