In a petrol engine the mixture is compressed about 9 times and ignited by a spark, in a diesel the mixture is compressed about 20 times and the heat of the compression is sufficient to ignite the mixture. (The original diesel used coal dust but it was not a success). A higher compression ratio is more efficient so fuel consumption is lower - and the absence of the electrical system can improve reliability.