system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why Is Diesel Preferred Over Petrol for Large Vehicles?
gpt
Torque, or how much force a motor can apply to the wheels at a given RPM. 

Diesel engines have a much higher compression ratio that gasoline engines. They work by squeezing their air-fuel mixture so much that it spontaneously explodes. Higher pressure in the cylinder delivers more turning power to the crankshaft, which is transferred to the wheels. 

The disadvantage to this is you need heavier engine components to withstand this violent force. This limits how fast the engine can turn. So diesels tend to produce most of their power at low RPM. 

Now if you're hauling a heavy load, that's exactly where you want all your engine power to be. You need that kind of force to get you moving, and most diesel vehicles don't need to go very fast. Nor do they need high acceleration.  

Now you could produce a gasoline engine that could match diesel torque levels. You see this in aviation engines, which need to produce a lot of turning force, but also need to be light. The problem is that gasoline will spontaneously ignite at a much lower temperature and pressure than diesel fuel. This causes a problem called knocking or detonation. The fuel prematurely ignites before the piston is at the top of the cylinder. This can severely damage engine components. Thus you need to introduce additives (boost the octane value) to reduce the ignition temperature. Unfortunately, doing so significantly increases fuel costs. Aviation gasoline (avgas) is usually around 100 octane. The average price today (Aug 13, 2016) is between $4.67 and $5.29 per gallon, depending on where you are in the US. Double the cost of diesel. Most avgas is also still leaded. It's a far more convoluted way to do things when there's a better and simpler technology available.

Diesel can also be more fuel efficient than gas as well, which is important for the long haul industry. It has a higher energy density. Which means you can get more work done with less fuel, even at those low RPMs. It's a little less efficient at high speeds though. A fine trade off for trucks, but it's partly why they're not common in North American cars.

A third advantage of diesel is it scales up in size quite well. The limiting factor becomes the transmission. You need a lot of big, robust gears if you want to directly drive the wheels. Train locomotives and ships use a diesel-electric transmission instead. The engine turns a generator which powers electric motors attached to the wheels/propellers. Electric motors produce a near constant torque across their entire RPM band. They don't need to be geared either, making them ideal for very large loads. Of course for a truck, this adds unnecessary complexity. 

Fully EV trucks will eventually replace diesel once battery life and recharge times improve. When you're getting paid by the mile, you can't really afford to wait a couple hours to refuel. Some trucks of the future may even use overhead lines like the Accela Express and other electric trains.