Electricity is the flow of electrons through a material. But for electrons to pass through a material they have to give up some energy, this is called a material's resistance. The energy that is lost from the flow of electrons, due to a material's resistance, is passed onto the material in the form of heat, which makes the material hotter.