Blame it on sulfur
Pee smelling bad after eating asparagus? Bad breath after a nice homemade bruschetta well rubbed with garlic? It is all the fault of sulfur, present in some amino acids (for this reason called sulfur dioxide) and in some compounds (such as garlic alicin) present in these foods.
The same sulfur helps to characterize the smell of cabbage and eggs gone bad.
The icing on the cake, sulfur is also responsible for flatulent odor eliminated after taking these foods.