There are many foods that taste a better with a little char -- steak, ribs, even salad -- but garlic is NOT one of those. Garlic doesn't even brown, it burns. And burned garlic means losing that mellow and delightful flavor to something acrid and pungent that no one wants to eat. In sum, burned garlic will ruin your dish.
But burning the garlic isn't always the result of absent-minded cooking. One second, garlic is well on its way to being perfectly golden. The next, bam, it's brown on its way to black. Why does this happen? Well, there's a very simple reason: garlic has a low water content, which means it doesn't take a long time for it to cook. That, combined with the fact that it's usually diced or grated super small, makes it cook very quickly.
That's why so many recipes instruct you to first sauté onions and other ingredients until soft before adding the garlic. If you try to cook the onions and garlic at the same time, the garlic will burn every time. Garlic only needs 30 seconds to two minutes to do its work. Treat garlic right, and it'll be good to you. Don't, and it'll hit you with some seriously bad flavors.