The idiom means that the person who provides the money for something has the right to decide how things should be done. The man who pays can call the shots.
“Since my friend is hosting the party, and he is paying for everything, he has the right to make all the decisions.”
“ I don’t agree with Jai at all, but he’s funding the project. He who pays the piper calls the tune.”
The owner has the right to decide who will play in the next match. He who pays the piper calls the tune.”
The origin of this idiom : In the old days, it was the job of the piper to provide music at the various ceremonies. Normally, he played whatever people wanted him to. But the kind of music depended on who was paying him.
Source: “The Hindu” – Know Your English Column – Jan 29, 2008