Heat the oil in a large saucepan over low heat, add the onions, and cook for 10 to 15 minutes, until the onions are translucent but not browned.
Add the garlic and cook for 1 more minute.
Add the rest of the ingredients.
Bring to a boil, then lower the heat and simmer uncovered for 30 minutes.
Use the sauce immediately or pour into a container and refrigerate.
Preheat the oven to 350 degrees.
Line a sheet pan with aluminum foil.
Place the ribs on the sheet pan meat side up and sprinkle them with salt and pepper.
Pour a third of the BBQ sauce generously on each rack and cover the ribs loosely with aluminum foil.
Bake for 1 1/2 hours for baby backs and 1 3/4 hours for St. Louis ribs, until the meat is very tender when tested with a fork.
As soon as the ribs are out of the oven, spread them generously with another 1/3 of BBQ sauce.
Grill right away or refrigerate to grill later.
Get your grill ready and place the ribs on the grill ribs-side-down, put the lid on top (be sure both vents are open), and grill for 5 minutes.
Turn the ribs meat-side-down, put the lid back on, and grill for another 4-5 minutes, until nicely browned.
Place on a cutting board, cover tightly with aluminum foil, and allow the ribs to rest for 10 minutes.
Cut into ribs and serve hot with extra BBQ sauce on the side.