What is the mechanical difference between a petrol and a diesel engine?
Both are internal combustion engines, and the fundamental difference is how the fuel is ignited — which determines almost everything else about how they behave.
Petrol — spark ignition. Air and fuel are mixed and drawn into the cylinder, compressed at a compression ratio typically around 10:1, and ignited by a spark plug at a precisely controlled moment.
Diesel — compression ignition. Only air is drawn in and compressed far harder, typically 16:1 to 22:1. Compressing air heats it substantially — well above the fuel's ignition temperature — and fuel is then injected directly into that hot air, where it ignites spontaneously. There is no spark plug.
What follows from that difference:
Efficiency. Higher compression ratios are thermodynamically more efficient, and diesel fuel contains more energy per litre. This is why diesels achieve better fuel economy, particularly at steady speeds.
Torque versus power. Diesels produce more torque at low revs, because the higher compression and longer piston stroke generate greater force earlier. This is why they suit towing, load carrying and motorway cruising. Petrol engines rev higher and produce more power at the top end.
Weight and cost. Diesel components must withstand far higher pressures, so engines are heavier and more expensive to build and repair.
Noise and vibration, from the abrupt pressure rise of compression ignition — much reduced in modern engines but still characteristic.
Glow plugs, not spark plugs, which pre-heat the cylinder for cold starting.
Emissions differ in kind, which is the crux of the modern picture. Diesels produce less CO₂ per mile but more nitrogen oxides and particulates, which are local air quality pollutants. That is why diesels were once promoted on climate grounds and are now restricted in cities, and why they need DPFs and AdBlue.
Petrol is better suited to short urban journeys, which is where diesel particulate filters fail to regenerate.