A diesel engine uses a slightly different fuel (still petroleum-based) and lots of compression. Compression is the ratio of how much the air-fuel mix is squished as the piston moves from bottom to top of the cylinder.
Gas engines compress the mix to make it around 10 times smaller; diesel engines compress it twice that much. Extra compression makes more heat, and that heat ignites the diesel fuel at precisely the right moment.
That ignition is more efficient than a spark plug in a gas engine and results in more torque and better fuel economy. Watch the Toyota Engines 101 video for more information on the other tradeoffs.