The compression ratio of an internal combustion engine is an important operating characteristic. It is the ratio of the volume inside a cylinder when the piston is at the very bottom (opening the most space) and the volume in the head when the piston is at the top of its range of motion. For typical automotive engines the higher the compression the more efficient the engine can be. This is fundamentally because a high compression ratio gives the hot combustion gases more opportunity to expand and do work. Imagine a compression ratio only a little above one. That would mean the energy filled gases, flush with heat from the combustion of the fuel would have barely any space to expand. They would thus do very little work. Then on the exhaust stroke they would be expelled to the air taking most of the energy with them. On the other hand, a very high compression ratio means that the hot expanding gas can do work over a much greater distance. That allows to extract more of the energy and waste less trapped in the exhaust gases. Miller cycle engines take advantage of this extra expansion without requiring a high compression ratio.
Secondarily to this is the fact that under compression, the fuel and air is tightly packed into a small space. This can help ensure complete combustion. It also helps control the combustion timing so that it is optimally phased relative to the piston position.
The limiting factor preventing high compression ratios is pre-ignition. This is commonly called knocking or pinging. The high temperatures generated during a high compression can cause the fuel to self ignite too early in the cycle. Such early ignition or detonation ruins the careful timing and reduces engine efficiency and power. Fuels that are more resistant to pre ignition are able to be run at higher compression ratios. This is the reason for the higher efficiency of Diesel engines. Typical automotive Otto cycle engines run at compression ratios of about 12 to 1 while Diesel engines with their different fuel run at around 25 to 1. Thus Diesel engines get more work out of their hot gases as they expand 25 times instead of just 12 times.