>>16214374Heatran evolved from Heatmor.
By evolved, I mean the real-world kind of evolution, which is known to happen in Pokemon as well.
Durant developed their metal casing to protect them from Heatmor (ironically, it made them more vulnerable.)
Heatmor feasting on the now metallic insects, over thousands of years, began to develop large amounts of metal in their bodies. Their body heat would keep the metal from cooling, but it ultimately became too dense, forcing the new subspecies to live exclusively in volcanoes.
They adapted to the terrain, their hands changing from claws to clamps, allowing them to walk on ceilings. Most died off from lack of a reliable food source, but those that survived became Heatran.