Why do the temperatures of the molecules in a substance vary, when they have an average temperature? What caused this variation?

Take a block of steel. The molecules on the outside may be in the sun. The molecules on the inside may have not reached equilibrium so those inside are cooler, at least for the moment, until the block of steel has the same temperature throughout.