What happens to potassium iodide in the "elephant Toothpaste" reaction?
The potassium iodide serves as a catalyst for the decomposition of the hydrogen peroxide by facilitating oxygen removal from the solution so the reaction is carried to completion. The rapid decomposition allows you generate a lot of gas quickly and the long cylindrical shape of the graduated cylinder directs the momentum of the gas in a vertical direction to achieve the gushing effect. Since potassium iodide is a catalyst in the reaction, it is not consumed in the process of making the foam, but exists as the ions that come from dissolving the salt in the hydrogen peroxide solution.

Reaction mechanism on wikipedia

P.S. This reaction is exothermic, so if you go really large scale, expect your vessels and the foam to be hot to the touch.