This is a way of saying that the person who is paying someone to do something can decide how it should be done.
This expression is first recorded in the 17th century. Many people believe it could have arisen from the English version of the legend of the Pied Piper of Hamelin, published in English in 1605. However, the parallels to this expression in other European languages suggest that it predates the fable and is more literal than figurative – that is to say, the person who pays the musician is entitled to ask for the tunes he wants to hear.
In olden days music for dancing on the village green and in other rural surroundings was provided by strolling musicians. Of course these pipers did not perform for nothing, and whoever paid for their services had the right to tell them which tunes to play.
The simpler phrase ‘pay the piper’ predates the longer version by some centuries. It was used simply to mean ‘bear the cost’, with no reference at all to controlling the piper’s playing. Thus the Earl of Chesterfield, writing to his son about his hopes for peace in Europe, said, “The other powers cannot well dance, when neither France nor the maritime powers can, as they used to do, pay the piper.” In other words, war is unlikely, because no one will foot the bill.
This usage remains alongside others right into the late twentieth century. Even when the phrase ‘call the tune’ is added, the resulting proverb is not, at first, used to control the piper, but rather to emphasise the rights of the payer as against others who might be enjoying the piper’s playing.
In our day to day life also, those who contribute money for any enterprise have the final say in the matter and we accept that as being fair. Rich men make big contributions to political parties to meet the expenses of election campaigns. And when those parties come to power, those who have contributed generously automatically influence the government.