While often complex, at its most basic both racism and sexism are mechanisms used by rich white men to deflect resentment of their entitlement & privilege onto groups that have spent years, decades trying to combat the prejudices they have confronted.
Their very success makes them a useful target of mis-direction when the entitled are looking to shift the blame for poverty, lack of opportunity & social exploitation.
The only really dangerous minority are the rich!