In gasoline engines, fuel is first mixed with air, then compressed by pistons, and eventually ignited by sparks from the spark plug. In diesel engines, fuel is injected after the air is compressed. When air is compressed it gets heated, which eventually ignites the fuel. Hence, it does not require spark plugs.