To build on what Sharnt said (and yes, this is very broad)--
Grocery store tomatoes are really awful. They might be okay to bulk up already flavorful things (eg, on a taco), but that's about it. Even the 'vine ripened' (ie, showing a little color when picked) ones that you pay more for are really a pale imitation to ones that you grow yourself or get from a farmer's market when they're picked fully ripe. Unless you specifically need raw tomatoes, you're often better going with canned. If they're too wet, you can always drain off the extra liquid. (but reserve it, in case you need to add some moisture back in).
Preparation also has a huge influence on things, especially on aliums (garlic and onions). Cooking them low & slow will bring out their sweetness and destroy the flavors that you get when they're raw ... a head of garlic allowed to cook slowly in the dish might give less 'garlic' flavor than a clove smashed and added at the end. For more info, see Is there any difference between chopped and crushed garlic in cooking?, How does the way that I cut my garlic affect the taste of my food? and (Why) do onions taste sweeter when cooked at lower temperature?.
Cooking over higher heat will also destroy some of those qualities, but not has much. It can also result in browning, which if stopped before burning can create more complex flavors. See Why sweat but not brown?.
Order of cooking can also play a factor -- brown the meat first, then add the onions (and possibly garlic) and cook it for a little bit, then add the tomatoes. How far you cook the onions before adding the tomatoes affects how firm the onions are (the acid helps keep them firm), and how much you develop the sugars in the onions ... or even caramelize the sugars in the onions if you keep the heat up and brown them.
Also note that there are many varieties of onions available -- yellow, red, white -- and some are 'sweet' (ie, less onion flavor) they tend to be paler yellow and less spherical (ie, a bit squashed). See What are the differences between different types of onions, and when do you use them? and What's the difference between green, white, and red onions?.
And similar to sweet onions, there's also elephant garlic, which has less garlic flavor, which is significantly larger bulbs (and not technically garlic).
It's also worth noting that spices can go stale on you. If the nutmeg is already ground, try a pinch of it, and see if it tastes like nutmeg (or anything, really). You can try adding them early to wake up the flavor during the higher heat part of the cooking. If you were using dried herbs, you can pour it into the palm of your hand and then crush them with your other hand to try to get more flavor out of it.