In the United States, up until the mid 1990's or so, diesel and gasoline were pretty much on par with one another. The primary reasons diesel started costing more include both federal and state tax increases on diesel, increased worldwide demand for diesel (especially in Europe, where gasoline exports increased and diesel imports increased), an increase in jet fuel consumption (refineries started producing more jet fuel and less diesel, thus reducing supply) and, as
@CID already pointed out, the new regulations and requirements that forced refineries to produce ULSD (ultra low sulfur diesel) increased refining costs.
Most diesel fuel is consumed by the freight industry (in the US). If/when the economy is booming, the demand for diesel goes up. US refineries are producing more gasoline than diesel (2:1 for every barrel of oil). In the five years leading up to COVID, GDP grew almost 10%. That created a direct increase in demand for diesel.
We enjoyed 8 years of economic growth between 2009 and right before COVID. Diesel averaged ~32 cents/gal higher than gasoline between '09 and '15, when diesel finally sold for less than gasoline for the first time in ~6 years (but not for long).
Lots of data on this over at the
US Energy Information Administration
On topic: Regular unleaded has been at $4.259 here for the last couple of weeks.