You may be interested in this previous answer from u/Iphikrates about the origins of classical Greek battle formations.