It is a common practice to give expression to one’s pleasure or to draw attention to any particular matter by the clapping of hands and the Arabs used to follow the same practice.
The Holy Prophet Muhammadsa, however, so loved the remembrance of God that for these purposes also he substituted the praise and remembrance of God in place of the clapping of hands. On one occasion while he was occupied with some important matter, the time of the next service drew near and he directed that Abu Bakrra (one of his companions) should lead the prayers.
Shortly thereafter he was able to conclude the business upon which he was engaged and proceeded at once to the mosque. Abu Bakrra was leading the prayers but when the congregation perceived that the Holy Prophet Muhammadsa had arrived, they began to clap their hands for the purpose both of giving expression to their joy at his arrival and also to draw Abu Bakrra‘s attention to the fact that the Prophetsa himself had arrived. Thereupon Abu Bakrra stepped back and made room for the Holy Prophetsa to lead the prayers.
When the prayers were over, the Prophetsa addressed Abu Bakrra and said: “Why did you step back after I had directed you to lead the prayers?” Abu Bakrra replied: “O Messengersa of Allah! How would it befit the son of Abu Quhafara to lead the prayers in the presence of the Messenger of Allah?”
Then addressing the congregation the Prophetsa said: “Why did you clap your hands? It is not seemly that while you are engaged in the remembrance of God you should clap your hands. If it should so happen that during the course of prayers attention has to be drawn to some matter, instead of clapping your hands you should utter the name of God aloud. This would draw attention to whatever may have to be taken note of.” (Life of Muhammadsa, p. 205-206)