What's the mechanism of action of a massage?

I don’t think it’s super well understood but there’s good guesses.

When you do repetitive actions, some of the muscles involved can kind of get “locked on”, have a higher resting tension level. Think of that trick where you press both arms against a door frame for a while, step away from the door and your arms raise without concious effort. Massage is probably breaking the cycle just from the stimulus of pressure, rhythmic motion and pain.

There’s also sensors in tendons that trigger muscle relaxation (golgi tendon reflex) which may be getting fooled into firing.

Another cause of muscle pain are trigger points, little hardened nodules, that can be physically broken down.