I've been thinking about this a good deal recently-I've always found it strange that common racist tropes of non-whites as being somehow childlike, primitive, "ape-like" lacking moral character, or otherwise inferior in some way have been remarkably consistent across the world and across the centuries' worth of European colonial rule, from 1492 all the way through to the 20th century, and in more understated forms ever since. I can sort of understand how, from a twisted point of view, these sorts of stereotypes could stick to peoples who lived a completely different mode of living to Europeans, such as in the Americas or sub-Saharan Africa when viewed from a European perspective unfamiliar with those cultures, but how did identical, or very similar ideas, come to be attached to places such as the Middle East, the Indian subcontinent, or East Asia, settled societies with very old intellectual traditions and political modes that would've at least been somewhat recognizable to a European observer?
>settled societies with very old intellectual traditions and political modes that would've at least been somewhat recognisable to a European observer
I suppose a short answer would be that European observers didn't just straightforwardly see those societies as they were, but instead created their own image of those societies that justified imperial control. This representation of other non-European societies was so all-encompassing and pervasive that it coloured the perception of those societies by later observers, who ended up perpetuating the same basic assumptions of European supremacy. If a British academic or imperial functionary had been conditioned to see the Arabs as inherently childlike and incapable of governing themselves, practically anything he saw or read would only confirm the assumption he already held; moreover, if the only authority on the Arab world was the writings of other Europeans rather than Arabs themselves, that too would fundamentally shape his worldview.
The fact that Europeans had centuries of contact with, for example, the Islamic world, was incidental. In his book assessing Oriental Studies in the West, *Orientalism*, Edward Said notes that the accumulation of writings about Islam and Arabs in Western Europe during the nineteenth and twentieth century wasn't so much a gradual buildup of objective knowledge about 'the Orient'; instead, it was the accommodation and re-adaptation of old ideas of power. In the case of 'Semitic' peoples (Arabs and Jews, who were conflated by 19c racial categories), having intellectual traditions that were somewhat familiar to (and even admired by) Europeans could even count against them. While European writers adored the ancient Orient of King David, Jesus and Cleopatra, this was always unfavourably compared with the modern state of those places, which (they thought) had 'stagnated', or had remained forever stuck in 'cultural infancy'. Respect for the ancient achievements for a culture could definitely coexist with racist contempt in the present - just look at European attitudes towards the Jews.
I really can't recommend *Orientalism* enough, on how powerful racial assumptions can be and how they perpetuate themselves.