This compassion emerges as a result of detachment from things and people. walking could break your sense of identity. Through walking, one develops a neutral lens, which responds naturally to suffering.

References

Gros, F. (2014). A Philosophy of Walking. Verso.

Alone at last, having purged his heart of all stupid passions and dropped his masks along meandering footpaths, Rousseau also started to feel a pure, transparent, limitless compassion growing within him.

But when you walk, it’s different: you no longer feel anything for the other, neither bitter aggression nor gushing fraternity. Merely a neutral availability, taking on colour when another is found in tears. Then through natural compassion the heart opens, dilates spontaneously before the apparent pain, like petals opening to light. And you go to their aid, you long to help with all your heart.

That was the discovery of those open-ended walks through the undergrowth, following wandering paths; losing yourself the better to hear your heart, to feel the first man palpitating within you.