When and how to add garlic to a dish?
The key is to understand what impacts the flavor and texture of the ingredients your using.  Then, to use the appropriate techniques to achieve the result you are looking for.  If you keep a peeled clove of garlic whole it can have an aromatic effect if gently cooked in oil.  Smash that clove and the effect is more powerful.  Brown the clove, and you will get sweetened and caramelized notes...go to far, and it will take on a bitter note.  Slice the clove and the effect will be different.  Smash and chop (or grate)...more pronounced and more integrated. Roast without peeling...sweet.  ...the list goes on...

Greater cooking experience will allow you to understand all of the potential nuances that different cutting, crushing and cooking (or not) of garlic can bring to a dish.  Then, you can understand, adjust, and/or create the recipe you are looking for.