Fat hardening; butter and margarine

Butter is a natural product of animal milk. Here we meet an animal (non vegetable) fat.
If we separate water and the proteins from the milk, we remain the animal fats: mostly a triester of glycerol and saturated fatty acids.
Butter is also such an ester of glycerol, but not exactly with a fatty acid, instead with butanoic acid. That acid, a liquid, can be set free and you will not like the smell. Keep butter in the freezer please.
A bit of this acid (butter acid) occurs in human sweat.

Milk is also the prime substance to make margarine. But in this production, you need also vegetable oil (i.e. palmoil).
A problem is that margarine is then a mix of oil(L) and milk(l), two liquids, one polar and the other non polar. In fact, this results in two problems:
So what now?

In the old days, in the old margarine factories, they resolved the second problem by using less oil and more milk, trying to apply the so called fat hardening process.
Vegetarian oil contains a lot of unsaturated bondings and that's why they are liquid. So they simply reduced the number of double bonds by adding (addition of) Hydrogen. This made the oil more saturated, and consequently harder.
This was only possible with a catalys and under pressure. The Hydrogen connects at the opened positions in the C-chain.
Those days, they did not know the value of unsaturated fatty acids.
Nowadays we all know dat saturated fatty acids can harm you veins, support high blood pressure or even hart attacks. So they wanted to eliminate that hardenings process.
And how to resolve then the problem of margarine being a liquid?

Yes, it is possible to mix in a special way a polar and a non polar substance: stirr well and shake until alle components get the form of very little spherical droplets, all nicely mixed together. We call that an 'emulsion'.
Such en emulsion is more or less solid.
Unfortunately not stable. After some time it will return to the two liquids, one upon the other.
This can be resolved by using emulgators: substances that stabelize such an emulsion. This way the emulsion 'margarine' can be put into packets, in cups or whatsoever. It stays stable for many weeks or even months.