Melt the butter in a large pot or Dutch oven over medium-low heat and add the onion and garlic. Cook for 4 to 5 minutes, until the onions start to soften. Be careful not to burn the garlic. Cut the corn kernels off the cobs. Add to the onions, along with remaining ingredients. Bring to a simmer and cook for about 25 minutes.
Whisk all the ingredients together in a nonreactive saucepan, place over medium-high heat, and bring to a boil. Lower the heat and simmer for 15 to 20 minutes, until the sauce just coats the back of a wooden spoon. Cool and use immediately or stare for later use in the fridge, where it will keep for 2 to 3 months.
Makes about 5 cups.