Here is the explanation:
Corpse flower or titan-arum (Amorphophallus titanum) is native to the island of Sumatra in Indonesia. Its enormous flower spike is the largest unbranched inflorescence (flower structure) in the Plant Kingdom.
Due to its odor, which is like the smell of a rotting corpse or carcass, the titan arum is characterized as a carrion flower, and is also known as the corpse flower or corpse plant (Indonesian: bunga bangkai – bunga means flower, while bangkai can be translated as corpse, cadaver, or carrion).
Carrion flowers, also known as corpse flowers or stinking flowers, are flowers that emit an odor that smells like rotting flesh. Carrion flowers attract mostly scavenging flies and beetles as pollinators. Some species may trap the insects temporarily to ensure the gathering and transfer of pollen.
It only gets worse:
Cadaverine and putrescine smell like rotting flesh. Skatole has a strong feces odor. Indole has a mustier, mothball-like smell. Hydrogen sulfide smells like rotten eggs.