The internet is surprisingly vague on the origin of clapping. The best I can find is that the practice of clapping as a way of applauding a theatrical or musical performance arose in the Middle Ages.
As the Reformation and the Renaissance released the strictures of the Church over secular life, there was a slow increase in surplus wealth and division of labor. (The Plague perversely helped with this, since when one-third of you die the two-thirds who are left alive are suddenly 50% wealthier!) As a result, public performances of music and theater became more common.
Actors and musicans found themselves playing to larger audiences than the palace court, so some of the older forms of applause, such as waving kerchiefs or snapping the middle finger and thumb, just didn't communicate very well. Besides, a less aristocratic audience would be expected to use a less formal and restrained method of applauding.
Cheering works, but even today in fairly rude America, it's not considered proper to yell at a symphony orchestra or a Shakespearean company unless it's one of the greatest performances of our life. Yelling is only used as the superlative form of applause.
I wouldn't be surprised to learn that clapping evolved out of the necessity to communicate pleasure and approval clearly, because our physiology and the technology of the era provided few other effective options.