This kind of coordinated movement is known as behavioral synchroy. It can also occur in other group activities such as games, religious ceremonies, or even dance.
It is possible to do better when you're already in close proximity to other members of the group.