Why do uncooked frostings that contain milk not need to be refrigerated?
Microbes need available water to grow, and sugar reduces the availability of water to them. In addition, spread as a thin layer on cake, water evaporates (further reducing water availability).

You can find out more about factors influencing microbial growth in the FDA's Bad Bug Book.

As the book notes, generally, you can only know from experiment if a particular recipe is safe, and also that often they're just slowed not stopped. So it'd probably be prudent to minimize the amount of time you store your icing/glaze.