Melt butter in medium saucepan over medium heat. Add onion and cook until softened,. Add garlic and cook until fragrant
Add ketchup, molasses, brown sugar, vinegar, mustard, chili powder, black pepper, and cayenne pepper and stir to combine. Bring to a boil, then reduce heat to low and simmer until slightly thickened, about 30 minutes, stirring frequently. Obviously the sugars can burn so be careful now.
Transfer sauce to the jar of a blender or hand blender and blend until smooth.
Let cool to room temperature, transfer to a jar and refrigerate up to a few weeks