And then there's oversimplification like this.
Racism and sexism may be triggered by envy or something similar but they don't have to be. The definer here is that the person believes the other (POC or woman, whatever) does not deserve what they have or deserve to be doing what they are doing because of who they inherently are. That's what makes it racism, sexism, ableism, ageism.
It's not just plain old envy. It's grievance because someone "inferior" or "undeserving" have what you want. Sometimes, it's just because they exist. They're another undeserving person taking up resources, space, and breathing air that make you feel squeezed.