The soup tasted mostly of garlic means that the garlic (one of the ingredients) was the dominant flavor.
However, I would say the soup tasted �garlicky � .
Tastes of Chicago means cuisine from Chicago.
Tastes like Chicago means the taste reminds you of food in Chicago.
Tastes like onion means it has the taste of an onion (it is an onion) or similar to an onion.
You can say an onion tastes like garlic because the tastes are similar,
but you cannot say an onion tastes of garlic because there is no garlic in an onion.