How does hot tub "shock" work?
There are several properties you can infer from the compound's name.


The compound is ionic, which the structure cation [...]-ate informs us. In this case, we're dealing with the potassium salt of peroxymonosulfuric acid. This should therefore dissolve pretty well in water.
The compound will be an oxidizer, in the conditions present in your bathtub. peroxy means the compound contains an $\ce{O-O}$ bond, which breaks up homolytically (one electron per oxygen) to give radicals (quite reactive species, electronically unhappy).


As per both hints, the compound is expected to be pretty effective at "eating" through organic deposits, by oxidizing them, rendering some soluble. It should also decrease pH, but not so drastically as it is already the conjugate base of sulfuric acid (which can let go of two protons).

About the bubbling: it most probably is $\ce{CO2}$ coming from the oxidation of the organic matter.