The story
From the repetitive grinding involved in playing a barrel organ. In figurative senses, from the common 19th-century practice of training monkeys to dance to an organ grinder's music in order to perform on the street and solicit donations and spare change.
Etymology from Wiktionary, CC BY-SA 4.0.