Which always leaves me wondering how common this would have been in the 1800s. Back in the days when listening to music at home meant playing it, was your average group of scalawags always going to have a few people who sang in the church choir as kids and knew things like oblique harmony?
With a little practice from young age, it’s not too difficult to harmonize, if you know the lead line and have a sense of culturally common chord structures (also learned by immersion).
Now to get closer to answering your actual question: from what I heard from some researchers (for whom visiting remote villages is part of their work), in shortest words, I understand people who were surrounded by songs all their life would "feel what is missing" by ear, and join with their voice to "fill the gap". Expanding a bit more on that, basically among every local community there were some people that were better at singing compared to the others. And singing tended to be required in some form, as part of various rituals (e.g. marriage, death are moments in life where you can be pretty sure there was some accompanying community ritual; and moms would shush and lullaby their kids even just for practical reasons). So it was more or less unavoidable to be familiar with singing to some extent. Now, as to the specific harmonies used in the modern sea shanties scene, I don't know enough to be able to say whether any of them are grounded in harmonies actually used on ships - that's not an area I've ever researched.
edit: Two more things: (1) higher layers of society tended to be derogatory towards the culture of the lower layers (I guess somewhat necessarily in order to differentiate and maintain status), so a lot of what you learn about history of music tends to be just about the music of the nobility, which often was just a small percent of the population; (2) also, singing is actually very close to speaking and shouting (see e.g.: https://www.youtube.com/watch?v=TYO_B5Nj8QY), so it's not hard to imagine singing in general might be at least as old as speech itself...
It is probably Varangians-Ukrainian folk music (ex-Kyiv Rus with a captital in Kyiv during period of 882–1240; actually Kyiv is a capital of Ukraine).[0]
> The Varangians later assimilated into the Slavic population and became part of the first Rus' dynasty, the Rurik Dynasty. Kyivan Rus' was composed of several principalities ruled by the interrelated Rurikid knyazes ("princes"), who often fought each other for possession of Kyiv.[1]
JFTR, Russia (ex-Moskovia) not exists until 1240s.
[0] https://en.wikipedia.org/wiki/Kievan_Rus%27
[1] https://en.wikipedia.org/wiki/Ukraine#Golden_Age_of_Kyiv