It seems it is predicted by both classical and quantum physics. Why is it predicted in the first place? Is it purely a mathematical reasoning, or is there some qualitative reason why it must exist? In other words, why would some philosopher/physicist hundreds of years ago say to himself, "I think every object emits electromagnetic energy in accordance with its temperature."?