There was a controversial book in the 90s called, “The End of Racism.” The author suggested racism, as it exists today, developed through The Scientific Age and The Enlightenment, and didn’t exist in antiquity. (Howard University professor Frank Snowden Jr. pointed this out in the 70s and 80s in books called “Blacks in Antiquity” and “Before Color Prejudice: The Ancient View of Blacks.”)
The enlightenment was supposed to replace the superstitions of antiquity with science and reason, but science and reason had myths of their own.
In an interview, The End of Racism’s author suggested that the Europeans were so impressed with their own ideas and inventions that they found other cultures primitive, and racism was the “commonsensical” way to explain the differences.
This “commonsensical” explanation was their declaration of White superiority, which, in itself, does not imply innate inferiority of other racial groups, but a doctrine developed that the White race should rule society because they were superior.
Now, the Europeans knew this doctrine of White supremacy was a delusion of grandeur. The early settlers wouldn’t have survived in the New World without the superior knowledge of the Native Americans, and the Europeans consciously chose to import Africans as slaves to the New World because of their superior ability to adapt to different environments.