It uses the rider's leg power multiplied by ride time and divided by typical human body efficiency. Note: Power is the product of rider's torque and cadence; both torque and cadence sensors are used to determine the cyclist's power input.
Example: Let the average rider's power input be 100 W, and let the ride time be 1 hour. The work done by the rider is 100 Wh. As human body efficiency is estimated to 25%, the human body input will be 400 Wh. Converted to kcal (multiply Wh by 0.86) it will give 400 * 0.86 = 344 kcal.
Your question was related to Kiox but any e-bike computer/controller or display (such as Specialized TCU controller) capable to calculate rider's kilocalories works on the principle I gave. (Heart rate is not taken into account).