How do they know the distance so they all line up.

Example en.m.wikipedia.org/wiki/At_attention