

The Ancient Greek name βάρβαρος (bárbaros) ‘barbarian’ was an antonym for πολίτης (politēs) ‘citizen’, from πόλις (polis) ‘city’. The earliest attested form of the word is the Mycenaean Greek 𐀞𐀞𐀫, pa-pa-ro, written in Linear B syllabic script.
The Greeks used the term barbarian for all non-Greek-speaking people, including the Egyptians, Persians, Medes and Phoenicians, emphasizing their otherness. According to Greek writers, this was because the language they spoke sounded to Greeks like gibberish represented by the sounds “bar…bar…;” the alleged root of the word bárbaros, which is an echomimetic or onomatopoeic word.
on the same page