Perhaps they were instructed by fallen angels in this and other matters?
That's undoubtedly one source of such knowledge, as there are numerous mythological and even Luciferian stories, to say nothing of the Book of Enoch, indicating that the fallen angels communicated such knowledge to human beings. In some cases, there was the so-called "primitive revelation" to Adam (and Eve) that would be transmitted.