Marathons are a competitive sport. Runners want to finish with both the best time they can manage and ahead of other runners. Long distance running is a juggle managing your energy and reserves while not hurting yourself.
Runners often find that the competition of pacing someone produces an overall pace a little faster than they might have thought possible. Pacing the person directly behind you keeps him or her behind you. As the runner in front you might find that you can maintain your position at a slightly easier pace, that is with less injury. Even if the final time is only a second difference you are still ahead in the field (you know, 233rd instead of 234th out of 500). Pacing a person in front of you keeps him or her in catching distance either at the end or at another key point like a water stop.
Drafting is when one runner is literally tailing the runner directly in front of him or her. There is a benefit to drafting, but just like in cycling, constant drafting is both poor sportsmanship and dangerous.
Despite running being a solitary sport, it's still a competitive sport. Your body has a little more energy with the motivation of a competitor.