Butter and margarine are both made up of long fatty acid chains, but some slight chemical differences mean differences in how they melt.
From
To