Fry onions and garlic before adding to the sauce?
Sauteing onions:


Softens them, most people prefer not to run into raw onions in their sauce. Onions will cook in a sauce, but very slowly, so frying them before makes sure they will be soft even if your sauce has a fast cooking time
Releases sugars, making them taste sweeter
Reduces the onion's harshness
Browning the onions creates flavor


Sauteing garlic: garlic needs very little sauteing, far less than onion


Softens the garlic although it will cook in the sauce much faster than onion
Releases the flavors 
Reduces harsh notes. The more you saute it the mellower the flavor but the less garlic-y it becomes. I often add garlic to my saute in 2 stages so I get both the mellowness and the edginess in my dish. It does mean adding more garlic overall, but it's worth it


So you get more depth of flavor, better flavor and texture sauteing them.