Triac switch cause of heating
The switch is not perfect, there is some voltage drop across is so power must be dissipated of load current x voltage drop. That's in addition to the base or gate power which is usually not very significant in a well-designed circuit.

For a triac the loss is usually of the order of 1W per ampere of load current (implying a voltage drop at typical currents of around 1V), but you should be able to find detailed curves and limits in the triac datasheet. See, for example, the BT138 (a 12A triac) datasheet, which shows typical voltage drop at 15A of 1.4V and maximum dissipation of about 6W at 5A RMS full conduction angle (Fig 1).