The story of the song's origin is easily accessible. Niles was collecting folk music in the small North Carolina town of Murphy during 1933 when he ran into a family of revivalists about to be booted beyond city limits as a public nuisance (they had been camping between services in the town square).
He was there for the family's final service, held with permission of the city fathers in the hope enough money could be raised to buy the gasoline needed to move on. Daughter Annie Morgan stepped forward and performed just a fragment --- three lines and a scrap of melody --- of the song we're all familiar with.
Niles asked her to repeat the fragment again and again, paying her 25 cents a time, until he had noted all that he could about it. He then composed around the fragment what now is one of the most widely known and performed of American folk carols, or hymns.
It's easily one of my favorite songs of the season although I'm not especially fond of many of the embroidered "emotive" versions that seem to be standard fare. I'll settle for old John Jacob himself.