system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How is a diesel engine such as the VW TDI able to obtain better fuel economy than an unleaded engine?
gpt
One of the factors which affects the efficiency of an internal combustion engine is the degree to which the working fluid (the hot gases) are allowed to expand, which is related to the compression ratio.

Diesels use a much higher compression ratio, so they start off with a higher maximum efficiency.

Add to that diesel fuel itself is more dense and contains more energy, and you have your answer.