Place garlic, tomatoes and chiles into a blender or food processor and blend to a slightly chunky (not smooth) sauce. Heat the oil in a heavy frying pan and add the onion and cook until it becomes translucent, about 3 minutes.
Add the blended ingredients and cook over high heat till reduced by half.
Make sure to keep scraping the bottom of the pan. There will be flecks of charred tomato and chile skin which is the way the sauce should be.
Read about how to roast fresh chile peppers or tomatoes.