system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 Why does certain types of pain (e.g. stretching/massaging a sore muscles) feel good?
gpt
A form of pain can come in the form of lactic acid build up.  When you massage the muscle affected it encourages blood flow which increases the rate of lactic acid break down which feels soothing.

Another form of pain can come from increased tension on the tendons.  When you stretch you elongate your muscles so they become more elastic with reduces the tension on your tendons and ligaments which feels soothing.

Another form of pain can come from muscle tear where the muscle fibres are torn.  When you massage the muscle this increase blood flow so the building blocks and repair blocks circulate to your muscles sooner.  This also reduces inflammation gradually which soon after feels soothing.

These are a few forms of pain which arise from muscles and how massaging/stretching works depending on how specific you wish to get it's more or less a similar process to the examples above.