Does icy hot really relax your muscles, or does the heat just distract you from the pain?

Heat packs. Heat does actually tend to relax the muscles, a benefit we are get from sitting in a hot tub or taking a hot shower. It also, however, distracts from the pain. So you get both benefits.
Not relaxer. Like rubbing your head when you bump it, products like icy hot "overload" nerve fibers that cause pain. They do not relax the muscle. Over a long term some of these products can stimulate increased blood flow which might help muscle healing.