The heat produced is due to the friction force. The surfaces of the moving parts of the machine must have friction. In order to move against each other, they have to overcome the force of friction. The work done by the moving parts against the frictional forces between their surfaces appears as heat. Generally, oil lubrication is applied in the parts of the machine which makes their surfaces smoother and hence reduces the friction between them. As a result, less heat is produced.