Have been noticing this for sometime, when I do regular weekly fitness like going to the gym I face post-workout inflammation or sore muscles but this is all very much expected and I noticed that if I don't do any fitness for a few weeks sometimes some pain in a leg or the back or a knee comes out and sometimes increases somewhat day over day but all these non-workout related pains disappear incredibly quickly as soon as I get back to my usual fitness training. I'd be curious to understand if there is any reasonable/logic explanation for this. Why does getting back to doing workout solve these non-workout related pains?
Pain is just a signal from the body to the brain. If a signal is not needed anymore then you are not gonna feel pain.
After punching for a lot of time, you will notice your hands do not hurt anymore, if you stop for a long period and then start again, the pain will come back. It it's just normal human nature.
Same goes for the muscles and many more systems in the body, sometimes when pain goes away is not because the problem is not there anymore but because the body doesn't need to send the signal anymore.
Some examples are chronic starvation or thirst, after some time the body stops giving signals of hunger or thirst, even if the the body is still dying.
Soreness is just a mechanism for your body to tell your brain "hey you put your muscle through some stress they were not used to"
You will feel sore every time your muscles are put through some motions they are not used too...a powerlifting champion can get sore from a light weight dumbell fly, because their muscles are not used to that specific movement. But they will not get sore from a heavy bench press, because it's expected by the muscles.
When you stop working out, your muscles and tendons will start to lose their flexibility since they won't be warmed up and moved as much. This can happen much more quickly than a noticeable loss of strength, and even a small amount of tightness in a joint or muscle group can lead to aches and pains, especially in load bearing joints like your knees or back. Then when you start working out again your muscles can warm up and stretch out again, which then solves the symptoms you were feeling.
If you aren't able to work out for a while and want to avoid that situation, you could try just actively stretching once or twice a day.