Ok, let's run through this again. Heavy distillate fuels (Diesel, jet A, kerosene, home heating oil) and (light distillate fuel) gasoline are some of the many products produced from distilling crude oil. Diesel is not a by-product of gasoline production. Through put at the distiller is more determined by the source of the oil. Some lighter oils produce more gasoline while heavier oils produce more diesel and similar products. The distillation process is mainly boiling crude oil and collecting the by-products at different vapor temperatures that and then condensed into the different fractions.
From the distillation process, the less desirable or less profitable products are run through a cracker. The cracker does exactly what the names implies, it cracks or breaks the longer chain molecules either by heat or reaction, or both, into more desirable end products. If there is more profit in gasoline this month, the cracker can take diesel and break it into gasoline and other by-products. At the end of both processes, you get a certain fraction of gasoline, heavy distillates, of which the other fuels listed above are part of, other commercially necessary gasses (lightest fraction)and sludge (heaviest fraction). The sludge is used for asphalt roads, shingles, sound damping, etc.
Distillate fuels are traded and priced on a global basis, same as crude. Whenever there is a hiccup in crude supply, there is a surge in fuel prices. It's called price speculation. You have to make enough money off of what's in your tanks to be able to resupply. Of course, the pendulum swings the other way but much more slowly on the down swing.