The Prophet ﷺ said, "You must straighten your rows, or Allah will set your faces against one another."
قال النبي ﷺ لتسون صفوفكم، أو ليخالفن الله بين وجوهكم.
Bukhari related it in the Book of Adhan (717), and Muslim in the Book of Prayer (436), both from the hadith of Shuba, who said, Amr bin Mura informed me, he said, I heard Salim bin Abu Jaad say, I heard Numan bin Bashir mention the hadith. Their wording is the same. In a version narrated by Muslim, the Messenger of Allah ﷺ used to straighten our rows as if he were straightening arrow shafts with them, until he saw that we had understood this from him. Then one day he came out and stood until he was about to say the takbir, and he saw a man whose chest was protruding from the row, so he said, "Servants of Allah, you will straighten your rows, or Allah will surely turn your faces against each other."Abu Dawud related it (662) through another route with a hasan chain, and in it, "Straighten your rows," three times, "By Allah, you will straighten your rows, or Allah will surely turn your hearts against each other." He said, I then saw a man pressing his shoulder against his companion's shoulder, his knee against his companion's knee, and his ankle against his companion's ankle.In another version, with a sahih chain, the Messenger of Allah ﷺ used to straighten our rows when we stood for prayer, and when we were even, he would say the takbir.The wording in Abu Dawud explains the phrase "Allah will surely turn your faces against each other." It means bringing about enmity, hatred, and division among hearts. Nawawi said this. It has also been said that it should be taken literally, meaning transformation and metamorphosis, based on his ﷺ saying, "Allah will make his form like the form of a donkey."As for al-qidah (with the qaf vowelled with a kasrah), these are arrow shafts as they are being carved and shaped, the singular being qadh (also with the qaf vowelled with a kasrah). The meaning is that he was thorough in straightening the rows to such a degree that they became as even and aligned as if arrow shafts were being set by them, due to how perfectly straight and level they were.