Did they assume that they were the gods they themselves worshiped under different names? Or did they think that the we're separate entities altogether?
I answered this with respect to Bronze Age religion in To what degree were Pantheons shared in the Late Bronze Age Near East?
I also answered with regard to the Roman imperial period here. I'm sure more could be said, and I'd happily answer any follow-ups.