Claus Westermann claims that the text of Genesis 6 is based on an Ugaritic urtext. In Ugaritic, a cognate phrase is bn ‘il. This may occur in the Ugaritic Baal Cycle.
KTU² 1.40 demonstrates the use of bn il to mean “sons of gods”.
KTU² 1.65 (which may be a scribal exercise) uses bn il three times in succession: il bn il / dr bn il / mphrt bn il “El, the sons of gods, the circle of the sons of gods / the totality of the sons of gods.”
The phrase bn ilm (“sons of the gods”) is also attested in Ugaritic texts, as is the phrase phr bn ilm (“assembly of the sons of the gods”).
Elsewhere in the Ugarit corpus it is suggested that the bn ilm were the 70 sons of Asherah and El, who were the titulary deities of the people of the known world, and their “hieros gamos” marriage with the daughters of men gave rise to their rulers. There is evidence in 2 Samuel 7 that this may have been the case also in Israel.