If we ignore the metal (eg cans, scrap metal and so on), the building materials
(concrete, old fill, tires, etc) and just focus on the organic part (vegetable and
food scraps, garden waste) there are very good reasons why this can smell
bad as it starts to age (ferment).

Components like sugars and fats in the organic part are fermented by bugs
(microorganisms) that invade the rubbish to produce methane and CO2.
The other essential component of the organic waste is protein which is
made up of amino acids and the microrganisms can break the protein
down to the amino acids and then ferment them as well.

It is the amino acids breaking down that probably make the worst smells.
Two of the amino acids have sulphur in them and this can then appear as
H2S (rotten egg gas), or COS (which is CO2 with a sulfur replacing one of the oxygens).
COS is a most evil smelling gas. All amino acids have nitrogen in them and
this can appear during fermentation as amines, which smell fishy, but two
of the amino acids (lysine and ornithine) have two nitrogens. When these
break down they each form diamines. One is called cadaverine and the
other putrescine and they smell VERY bad. (Cadaver is another name
for a dead body and something that smells bad can be described as putrid).

Interestingly, some plants, like the Stink Iris (Iris foetidissima) use these
stinking diamines to attract flies to fertilise their flowers, unlike most plants which
use perfumes and nectar to attract butterflies and bees for the same job.