Well, in a way it's the folk process at work, Murray. People sang/sing what they remembered. Or, just as often, they sang an approximation of what they remembered and filled in the rest.Me, I actually have the sheet music. I think maybe my great-aunt sent it to me with some other songs she thought I should learn on the piano. But maybe we bought it. Anyway having the music in front of me has always helped to fix tunes in my mind, so that the early songs I played on the piano are ones that I learned pretty solidly.
But a lot of people would write down the words of songs and either "everybody knew" the tune, or the writer knew the tune and was just trying to memorize the words. Lots of times folks didn't have any kind of musical notation that was convenient, I suspect.
This does not change the fact that I get irritated when people don't sing the "right" version of a published song. My mom was the same way: She got mad at Dinah Shore and Perry Como, back in the early 50's I guess, for the liberties they took with words & tunes.
Rita F