From 《左传·襄公十四年》: the allied army was ordered "at cockcrow, yoke the horses, fill the wells and level the stoves — just look at my horse's head to know which way to go". Originally a battlefield order for unified movement.
grammar
Classical word order: 马首是瞻 = 瞻马首, where 是 serves as an object-marker inverting "watch the horse's head". Fossilized in the idiom.