We talked about why snow and ice melt, and why chocolate melts. Butter is similar. And a little bit different.
All of them melt when a rise in temperature shifts the equilibrium between melting and solidifying. Butter, like chocolate, contains a mixture of fats. But butter has a wider mix of different fats, and doesn’t melt at a particular temperature all at once. Butter softens over a range of temperatures, until finally a temperature is reached where it is almost entirely liquid.
Butter is different from ice in another way. Butter is an emulsion of tiny water droplets inside of the fat. Each droplet is completely surrounded by fat, and the fat forms a continuous coating over all of the water droplets. Like soap bubbles and the bubbles in bread and cookies, a surfactant molecule (in this case milk protein) keeps one end in the water and the other end in the fat, stabilizing the droplet and preventing it from joining other droplets. This keeps the butter from separating into a layer of water and a layer of fat.
When the butter melts, the droplets are freed, and they do join together. You can see the layer of water under the layer of melted fat when you melt butter in a pot.