I think it's a combination of a lot of things.....melodies and means of chanting sometimes came to great masters in "visions," etc.
There's a funny song, I think it was from Jamyang Khyentse Wangpo, about the differences between lineages--and he talks about the differences in chanting styles--"Gandenpas chant from deep below, Nyingmas chant through the nose, " or some sort of funny comments like that. He also pokes fun of every lineage, before really making some terse statements about the great benefit of all....
There are quite elaborate systems of music, melody, chanting, etc., for every lineage--even for sub-lineages. I'm sure even the various Nyingma lineages have quite a variety of styles, melodies, etc.
A few years back I was very fortunate to have two Bhutanese (Drukpa Kagyu) Loppons stay with me for a while, and we did a shrine consecration--I joined them, and their methods of chanting, melodies, music, etc. was utterly unlike what I'd been taught. The varieties are truly endless!
At the moment, when unfamiliar, I just rise and fall with the tide of actions by those who know what they are doing! LOL