Preheat your grill to medium heat (about 350°F).
Rub the chicken quarters with olive oil to help the spices adhere.
In a small bowl, combine the kosher salt, black pepper, paprika, garlic powder, onion powder, and cayenne pepper (if using). Generously rub this spice mix all over the chicken, ensuring it is well-coated.
Melt butter in a medium saucepan over medium heat. Add onion and cook until softened, about 5 minutes. Add garlic and cook until fragrant, about 30 seconds.
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.
Place the chicken on the grill, skin-side down. Grill for about 10-15 minutes, or until the skin is crispy and has nice grill marks.
Flip the chicken and move to indirect heat. Close the lid and continue cooking for another 20-25 minutes, or until the internal temperature reaches 165°F.
During the last 10 minutes of grilling, start basting the chicken with the Kansas City BBQ sauce every 5 minutes. This will create a sticky, flavorful glaze.
Once the chicken is done, remove it from the grill and let it rest for about 5 minutes.
Serve the chicken quarters with extra Kansas City BBQ sauce on the side for dipping.