Keep in mind race in antiquity was far more centered on culture than skin colour. However just as it is today it is based on xenophobia, ethnic inferiority/superiority and culture. It is these type of environments which isolate a group or groups from the larger culture thus setting the stage for racism.
This is why have a degree of sympathy for those who opine that islamaphobia is akin to racism. Islam is not a race but people will use aspects of Islam that the majority do not practise and use that as the defining feature of a vast, majority of people who are no more peaceful nor aggressive than their non-Muslim counterparts.