Liberalism inadvertently helped create the artificial concept of “race” and the false belief of “white” superiority.
Prior to liberalism, Western Europe was dominated by Catholic Christian thought. Since the Bible didn’t outlaw slavery, instead telling slaves to be obedient to their masters, Christian thought generally didn’t view slavery as a problem or something to be abolished.
Since the time of (Christian era) Roman legal thought, and Thomas Aquinas’s influence by Aristotle’s justifications for slavery, Christian thought generally held that while slavery wasn’t the natural condition of man, it was a type of punishment for sin/crime for those deserving of it. It was argued that those who were unable to help themselves, needed to be put to labour by those who could better look after them.
During the Crusading era, the Catholic Church encouraged enslaving ‘infidels’ as a means to subjugate them, and bring them to believe in (Catholic) Christianity – ‘guided’ by the hands of their (Catholic) Christian captors. This opened the door for justifying exploitation of West Africans and trading with West African states for the slaves of the rival tribes captured by them.
During this situation, arguments arose from Christian thinkers justifying enslaving “infidels” rather simply inviting them to Christianity, by re-locating the supposed “Curse of Ham” (a curse on the descendants of Canaan) to be referring to the Africans. Previously the “Curse of Ham” had been used to refer to European Serfs, of whom it was argued were the ‘Hamites’ and were made to fit into a “God ordained” caste system of serfdom ruled over by ‘nobles’). However, despite this newly adapted Christian argument, it was still generally accepted that the ‘Hamites’ weren’t a different race, but a cursed lineage descending from Adam ﷺ.
However, this was about to change as the Western European ‘Enlightenment’ (rise of materialist political and ethical philosophies) started in the 17th century, and Biblically based arguments for the lineage of mankind (and everything else) were increasingly challenged.
With the rise of an early form of liberalism, or ‘classical liberalism’, corresponding to the newly won political rights or “liberties of the Englishman” against absolute monarchy in the 17th century England, and the seminal work by John Locke summarising the new stream of thought, it was gradually adopted by Westerners the belief in ‘human freedom’.
This new aqeedah (dogma) of individualism is best described by the Lockean summation ‘Man in the..be absolute lord of his own person and possessions, equal to the greatest and subject to nobody, all being kings as much as he, every man his equal’ 
While these concepts were adopted en mass, and readily adopted by numerous advocates throughout the Western world, it presented a problem for many of these ‘new converts’ to [Classical] liberalism – the issue of their heavy investment of industry in [african] slavery.
Now individual sovereignty was argued on two bases in this new thought, one was spiritual, the equality of all the souls of the descendants of Adam, and the other a materialist basis, the equality of all men possessing the faculties of reason or intellect.
If all of mankind was absolute lord of themselves, and equal to every other man, how can slavery of men be justified? While it is known that John Locke himself justified slavery in this book, Two Treatises on Government, his arguments that slavery was a punishment for crime or war didn’t fit well the many generations of African slaves in the Americas that were born into slavery and hadn’t committed any crime.
Since many of these [Classical] liberals wanted to continue and/or industrialise the age-old practice of slavery, or the ownership of people, they adopted the argument argued the rule of absolute sovereign of all men over themselves, isn’t broken by denying that “black” people were the same “race”, in essence they argued that they were a lesser form of “man” with less intellects and therefore didn’t deserve the same kind of right to sovereignty over themselves.
Since materialism can’t produce justification for why any form of matter (incl. humans) should deserve rights, the materialist ideology of classical liberalism couldn’t clearly establish why it was wrong to categorise humans into different categories and treat them differently.
It was actually the action of Christians (or materialists from Christian backgrounds) adopting liberalism and using Christianity’s Abrahamic teachings (also in Islam) that all human SOULS start off equal, that were able to make an effective argument for the equality of all humans. To illustrate this, consider the difference of treatment argued by liberals between humans and animals. Surely both are living creatures that can live independently and feel pleasure and pain? However, human intelligence is argued to justify why humans get more rights.
By this liberal argument, if intelligence is what gives more rights, do the less intelligent humans then deserve less rights than the more intelligent? This was the argument made for inequality by racist racialists when they falsely argued that some ‘races’ are more intelligent.
Eventually the argument considered intelligence differences within a “race”, by some classical liberals arguing that the mentally deficient or ‘imbeciles’ (as Winston Churchill put it) shouldn’t be allowed the same rights to breed and weaken the gene pool. This led to justifying eugenics.
Eventually, all these conclusions in classical liberalism were averted by non-materialist arguments made from a variety of sources (including Abrahamic ones), that argued for the equality of respect for all humans, and equality of all living things that can experience suffering.
But materialists employing ‘equality’ as an unquestioned dogma (to avoid cognitive dissonance), took its course beyond animal rights, to the idea of animal equality with humans.
However since in the ‘material world’ there exists no ‘rights’ between how animals treat each other, especially between carnivores and prey. Where do rights come from?
Without a divine criteria to explain the purpose (i.e. the ‘should’/’shouldn’t) and place of material things living or inanimate, materialism/liberalism has (ironically) nothing solid to prevent ‘justifications’ for anything.
Only the Creator can establish clear & firm rights
Islam abolished compelled labour in all circumstances (except enemy POWs, but gave them rights, see video here) and considered all humans, of any hue, to be initially equal in the eyes of Creator.
This prevented the Western idea of “race” arising in Islamic thought.
 ‘Slaves, obey your earthly masters with respect and fear, and with sincerity of heart, just as you would obey Christ’ [Ephesians 6:5]
 Experiments and Considerations Touching Colours (1664)
 Two Treatises of Government, John Locke, 1689