What is the chemistry behind the reaction of KNO₃, K₂CO₃ and Sulfur?
Here's just a guess, but I do have some confidence that I'm right:
$\ce{KNO3 + S -&gt; K2SO4 + K2SO3 + K2S + K2O + SO2 + N2}$
$\ce{K2CO3 -&gt;[\Delta] K2O + CO2}$
The first, unbalanced equation is the reaction between potassium nitrate and sulfur, producing quite some gas as product, and a variety of potassium compounds left behind, with the composition depending on your formulation of the powder. Of course there might be some sulfur trioxide produced, but the major oxide of sulfur should be the dioxide. In the second equation is the thermal decomposition of potassium carbonate releasing carbon dioxide. This is the part that I'm not very sure of, but it may be to release more gas to give your reaction more puff. However, IIRC the decomposition requires a very high temperature. In contrast, bicarbonate has a much lower decomposition temperature and also release more gas(carbon dioxide and water), but the products would likely be absorbed by potassium oxide to form hydroxide and carbonate, so  bicarbonate might not help much.