As marathon running booms, researchers are uncovering why the sport can reshape the brain, build resilience and create a new sense of purpose.