there is no such thing as "the perfect BBQ", it simply does not exist because every person, every region of the country has "THEIR" perfect version. It varied by state and sometimes within a state (North/South or East/West)
Most require smoke, but there is a general formula...
Rubs differ for each kind of meat and even different portions of meat, but all are applied before you even get a fire started and are at the very least let sit on the meat for 8 hours, 24 is better.
Wet glazes or injections are added just before putting it on a fire (some glazes are added after the meat has cook a while).
My rubs vary with a Brisket and other beef meat rubs being heavy on black pepper, salt, paprika and only a little sugar.
Chicken i like more sweet, heat from hot pepper (not black), ginger and cumin. Depending on the wet sauce, i will add orange zest (dried).
pork will add still more sugar, definitely orange zest and still more heat and there is a difference if i do a pernil vs regular pork butt or rib
fish in tricky (mostly salmon) because i do not BBQ it. i grill it quickly and get a good smoke flavor, but it is soaked in an acidic(orange juice) wet marinade which is sweet (with pure maple syrup), hot (dry chipolte peppers) and salty.