In olden days music for dancing on the village green and in other rural surrounding was provided by strolling musicians. Of course these pipers did not perform for nothing, and who ever paid for their services had the right to tell them which tunes to puts play. By extension the proverb means that a person who puts up the money is to be expended.
‘Well, he gave the Cricket Club thirty five pounds for a new motor-mower, so I don’t see how we can spend it on cricket caps and Club ties. Don’t forget that he who pays the piper calls the tune.’