Although gasoline engines have improved a lot, they are still not very efficient at turning chemical energy into mechanical power.
Most of the energy in the gasoline (perhaps 70%) is converted into heat, and it is the job of the cooling system to take care of that heat. In fact, the cooling system on a car driving down the freeway dissipates enough heat to heat two average-sized houses! The primary job of the cooling system is to keep the engine from overheating by transferring this heat to the air.