Why do gummy bears explode when added to hot potassium chlorate?
Potassium chlorate is a source of oxygen. After heating, it decomposes to $\ce{O2}$ and $\ce{KCl}$:
$$\ce{4 KClO3 → KCl + 3 KClO4}$$
$$\ce{KClO4 → KCl + 2O2}$$

The gummy bear is mainly composed of sugar and other carbohydrates. Those carbohydrates will react with oxygen, combustion occurs. For example, glucose will react in this manner:
$$\ce{6O2 + C6H12O6 -&gt; 6CO2 + 6H2O}$$

If there is any material present which does not burn, such as $\ce{H2O}$, the temperature will not rise as high. For gummy bears the reaction works spectacularly because they are mainly carbohydrates (>70%).

An apple, for example, has only ~13% carbohydrates – unless you dry it, of course. On the other hand, this video on YouTube is an example of how sugar itself reacts violently with potassium chlorate.