All these forms of discrimination are legal and necessary. However, some types of discrimination in employment have been made illegal. Discrimination is treating one person differently than another because of a particular characteristic. Illegal discrimination is unfavorable treatment of a person by category, class, or group rather than objective treatment on the basis of merit. Under EEO law, it is illegal to discriminate on the basis of race, color, national origin, sex, age, religion, or disability.
Discrimination can be intentional or unintentional.
When you're treated differently because of race, color, national origin, sex, age, religion, or disability, your rights are being violated, and that is illegal discrimination. There are Federal and state laws which prohibit illegal discrimination.