I've heard from a lot of people that swimming helps relieve sore muscles, is it true?
If true, why?
If we're talking about delayed onset muscle soreness (DOMS), there is little that attenuates the discomfort.
I don't think there's any evidence to suggest swimming in particular helps, but anything that increases blood flow to the area will lessen, to a degree, the pain.
Light exercise (of all stripes, so long as you're exercising the affect muscles) seems to help a bit through the poorly understood mechanism of exercise induced hypoalgesia.
As an example, most people with DOMS in their legs will feel less discomfort if they go for a walk. But when the walk stops, their legs are sore again.
It can help when you do light exercise but it won't make any pain of discomfort magically disappear. You can also get muscle soreness from swimming. I am part of a swim team and because of the sudden increase in exercise a lot of my muscles are currently soar, so you need to know that muscles can still be soar with swimming. Although it can decrease some pressure with can alleviate pain depending on the type of muscle soreness being experienced.