Diesel engines vs. gasoline engines
Diesel engines don't rely on spark plugs, but they still work by igniting the fuel to generate a force that moves a cylinder in the engine. The air/fuel mixture in a diesel engine is ignited by the compression of the same cylinder during the "compression" stroke. That is, like most gasoline engines in cars, diesel engines are four-stroke engines.
The compression stroke, in a gasoline engine or in a diesel engine, causes heating of the cylinder contents as the compression happens. Diesel engines are designed to have a more severe compression of the cylinder contents during the compression stroke. This results in much higher heating of the contents; in fact the temperature becomes so high that the ignition of the fuel and air becomes spontaneous.
You may ask, where does the energy to power the compression stroke come from? It comes from inertia in the engine as it is running. Another way to say it is that the previous power stroke provides the energy for the compression stroke. (The power stroke is when the exploding air fuel mixture pushes the cylinder out, doing useful work.) There is so much work released in the power stroke that there is enough to move the car forward as well as provide inertia for the next compression stroke.
Here are some more web links with helpful explanations:
Wikipedia:
The diesel engine (also known as a compression-ignition or 'CI' engine) is an internal combustion engine in which ignition of the fuel that has been injected into the combustion chamber is initiated by the high temperature which a gas achieves when greatly compressed (adiabatic compression). This contrasts with spark-ignition engines such as a petrol engine (gasoline engine) or gas engine (using a gaseous fuel as opposed to gasoline), which use a spark plug to ignite an air-fuel mixture.
The diesel engine has the highest thermal efficiency of any standard internal or external combustion engine due to its very high compression ratio and inherent lean burn which enables heat dissipation by the excess air.
How stuff works:
In theory, diesel engines and gasoline engines are quite similar. They are both internal combustion engines designed to convert the chemical energy available in fuel into mechanical energy. This mechanical energy moves pistons up and down inside cylinders. The pistons are connected to a crankshaft, and the up-and-down motion of the pistons, known as linear motion, creates the rotary motion needed to turn the wheels of a car forward.
Both diesel engines and gasoline engines covert fuel into energy through a series of small explosions or combustions. The major difference between diesel and gasoline is the way these explosions happen. In a gasoline engine, fuel is mixed with air, compressed by pistons and ignited by sparks from spark plugs. In a diesel engine, however, the air is compressed first, and then the fuel is injected. Because air heats up when it's compressed, the fuel ignites.
Be sure to watch the animation at How Stuff Works. It's quite helpful!
Diesel fuel vs. gasoline
In diesel engines, premature combustion can be a problem. This happens when the fuel ignites "too early" in the compression phase, before maximum temperature and thus maximum efficiency can be obtained. This means that by design, diesel fuel is a bit harder to ignite than gasoline. It's made of slightly less volatile hydrocarbons.
As noted by @steveverrill in the comments, the above paragraph was incorrect. A better explanation (straight from his comment) is
Diesel is harder to ignite at ambient temp due to its lower volatility / higher flash point (approx 52 °C vs -43 °C). This means it's difficult to form an explosive mixture which could be ignited by a spark (which is a local area at much higher than ambient temp.) But inside an engine both diesel & gasoline are fully evaporated. Under these conditions diesel is easier to ignite due to its lower autoignition temperature (approx 265 °C vs 280 °C). Autoignition temperature is tuned by additives to help ensure diesel can be ignited just by compression, whereas gasoline cannot ignite without a spark.
Wikipedia again
Petroleum-derived diesel is composed of about 75% saturated hydrocarbons (primarily paraffins including $n$, $iso$, and cycloparaffins), and 25% aromatic hydrocarbons (including naphthalenes and alkylbenzenes). The average chemical formula for common diesel fuel is $\ce{C12H23}$, ranging approximately from $\ce{C10H20}$ to $\ce{C15H28}$.
Wikipedia on gasoline
The bulk of a typical gasoline consists of hydrocarbons with between 4 and 12 carbon atoms per molecule (commonly referred to as C4-C12). It is a mixture of paraffins (alkanes), cycloalkanes (naphthenes), and olefins (alkenes).
Thus, diesel fuel contains mostly hydrocarbon molecules that have on average 12 or so carbon atoms, while gasoline contains hydrocarbons that contain on average 8 or so carbon atoms. The heavier, bigger molecules in diesel fuel means it evaporates more slowly at ambient conditions, requires more heating (i.e. more compression) before it spontaneously ignites.
adiabatically
I will have to look this up. $\endgroup$