system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5:what's the difference between a car that runs on diesel and another that runs on gasoline?
gpt
Diesel fuel engines use compression to create heat and pressure, which causes the fuel to "autoignite."

Gas engines use a spark.

Octane is a combustible liquid that gasoline is compared to. Octane is resistant to igniting under pressure, and the higher resistance to igniting under pressure gasoline has, the higher the "octane rating." Gas is bought at the pump with three different choices of octane rating.

"100 octane gas" is gasoline that has the same resistance to igniting under pressure as pure octane.

Cetane, on the other hand, is what diesel is compared to. Cetane ignites very easily under pressure. Diesel only comes from a pump in one cetane rating, (I believe) it's 27.

Diesel fuel can preignite in a gas engine, causing it to "knock." (Pressure moving against the direction of the engine, breaking shit) while in a diesel engine, gasoline will not burn at all. 

Further, gasoline engines use (nowadays) fuel injection to spray for into the intake manifold, where the air and fuel mix before entering the engine, vs. a diesel engine which injects fuel at the height of compression. That's because, if diesel engines had a fuel system like gasoline engines do, the diesel fuel would ignite before the height of compression, and the engine would (at best) backfire and turn off, or at worst, knock hard and tear itself apart.

Gasoline, on the other hand, will not ignite without a spark due to its high octane rating.  

Diesel fuel does have an octane rating, just as gas has a cetane rating, but they are both respectively very low.