The best combustion efficiency that can be achieved on a fully warmed-up gasoline engine is about 98%, meaning that 2% of the fuel doesn’t get burned. The main obstacle is that the flame will burn up to but not ever reach the combustion chamber surfaces. This is called flame quenching. Therefore, for every engine cycle, the fuel/air mixture that is right adjacent to the chamber surfaces (including various crevices) does not burn. This gets emitted from the cylinder as HC emissions. In addition, some of the carbon atoms don’t fully react to CO2 and instead from CO, and due to the high peak temperatures in combustion, some of the Nitrogen gets oxidized to Nitrogen oxides (NOx). Without a catalytic converter, no engine would pass emissions standards due to the emitted concentrations of NOx, HC’s, and CO.
Diesels engines have a very different combustion process, but complete combustion is still not possible. There will be significant emissions of NOx and Soot, but very low HC and CO