Preheat oven to 350 degrees. Spray a 13x9 inch casserole dish with cooking spray.
Whisk together BBQ sauce, ketchup, water, mustard, vinegar, granulated garlic and cayenne. Set aside.
Heat vegetable oil in a medium skillet. Saute onions until softened and translucent, about 5 minutes. Set aside.
In a large bowl, stir together beans, Rotel, onions and BBQ sauce mixture. Pour into the baking dish and even the top with a spatula. If you are using the bacon, lay the bacon pieces on top of the beans spreading them out evenly across the top.
Bake uncovered, until beans are bubbling and the bacon, if using, is cooked through, about 1 hour to 1 hour 15 minutes. Let rest 15 minutes, and then serve.
Enjoy!