The answer is... When electrical current flows through a type or kind of material, the electrons come in contact with the small atoms of the material and their collision produces heat. When the flow is through or going through a resistor, the resistance is offered to the flow and the collisions will generate heat. This is the reason why temperature rises. Hope this helps!