Ajam (عجم) in Arabic means non-Arabic-speaker. Ajam is an Arabic word that came from Jam the name of a king or prophet according to old story he was the king of world. The early use of the term included all of the peoples with whom the Arabs had contact including Persians, Pakistanis, Greeks, Ethiopians, and the somewhat related Nabataeans.
During the early age of the Caliphates, Ajam was often meant the same thing as barbarian. In some cases it was a word that was used as a way of making people seem like they were not as good as them. In the Middle East, it was usually used to the Persians. In Turkish, the usage of the term is not used to any group of people from a country, but instead seems to have changed from the original Arabic usage for outsiders and turned into a different meaning as the term ajemi (in modern Turkish acemi) which means clumsy, inept or novice.