The process is called "social categorization".
Social categorization alludes to the way a man's mind bunches together people who share critical qualities. A man rationally bunches individuals based on their statistic highlights (e.g., sex, age, ethnicity, or religion), identity and interests (e.g., extraverts, geeks), and occupation, to name probably the most widely recognized sorts of social classifications.