It's linked to entropy increase, as spontaneous heat flow leads to higher entropy states, in accordance with the second law.