Electric cars don’t heat the cabin by using wasted heat energy from the engine as an ICE does. Electric motors are too efficient and don't produce enough heat to use in this way. Instead, an EV uses a heat pump system. This works much like an air conditioning system.
A heat pump takes heat energy from the outside air and compresses it. This compressed air is kept warm as it travels through the system and is then released into the cabin.
As heat pumps are very efficient, this is a much more sustainable and eco-friendly way of heating a car. The most efficient can generate over 4kW (kilowatts) of heat energy for every kW of electrical energy used. They also barely waste any energy.