system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do diesel engines work? Why would they be preferred?
gpt
Diesel fuel burns differently than gasoline.  It's a thicker, less volatile fuel that burns more slowly than gasoline (think of the difference between setting a cup of gasoline on fire, and the ease of doing so, compared with doing the same thing with a cup of oil).  So, when the gasoline in a cylinder burns, it does so very quickly.  It only provides propulsive energy when it burns, so it only provides that oomph for a very short time, so you need to have more repetitions of this to get things moving, hence the higher comparative rev rates of gasoline engines.  Diesel burns more slowly, so it ignites and it keeps pushing for longer.  So, you don't need as many revolutions of the engine to get the power out of it.  This longer push in the cylinders also results in the engine creating more torque.

Diesel is also ignited differently.  It isn't ignited with a spark like gasoline is.  Rather, it is compressed to a very small volume, until that compression creates enough heat to cause ignition.  This high pressure means that diesel engines have to built very strong, to withstand that pressure.  The end result is that you have a very toughly built engine that revs low and creates a whole lot of pull out of those low revs.  So... diesel is preferred in those situations that benefit from those characteristics.  And that means hauling, where you have a lot of weight that you need to get moving and keep it moving.  You don't need the high-revving horsepower of a gas engine for that.  You need that slow-burn torque of a diesel for that.  Yank all that weight off the line and just get a head of steam going and keep going.  That's hauling, and that's diesel.