They don't have to do it by legislation. They do it by culture. Whether the marketplace is English, the absorption of the national holidays, the speeches, the mythology of the country. It's all part of the abstract attempt to foster a collective identity, which in part is done to modify or remove certain previous societal preferences. It's hardly sinister. It just is.
I have first hand knowledge and experience with this, so let me share some examples.
When I was 6 years old and growing up in Colorado, my teacher asked my mom to come and speak to the class about Sweden and our different customs and all of that. She did. A few days later, as I was going to sit with my friends for lunch, one of the kids stood up and said "Only AMERICANS are allowed to eat here." Everyone else joined in, and I had to eat lunch by myself.
Luckily, kids have short memories and by the next day I was hanging out and eating lunch with my friends again. Turns out what had happened is my friend had gone home talking about Sweden, and his redneck dad told him "America is the greatest country on earth" and the kid took it the wrong way... and the other kids were just following the ring leader.
As a kid, I always felt embarrassed by my parents accent and I never wanted them to speak Swedish in public. I hated feeling so different from everyone else and I was jealous of all the kids who were just normal Americans.
When I was 15, my family moved from Colorado to Chile in South America. I was easily a head taller than everyone else, and clearly there was a racial difference too. I can't say it was all bad - the girls loved me and everybody treated me like I had money even if I didn't - but EVERYONE treated me like an outsider. It culminated one evening when I was outside waiting in line for a concert with a couple of my hispanic American friends when a gang of Chileans came up to me "Oye GRINGO!"
I was jumped by 10+ thugs just because of the color of my skin and because I was speaking English. I fought my way out of it but not before fracturing a couple bones and getting cut up pretty good.
When I was 17, my family and I moved back to Sweden. You would think that would be a good thing, but having left Sweden at the age of 3 I had an accent, and I couldn't read or write at my grade level in that language. So rather than attend a Swedish public school I attended a school largely populated by British expats. There, it was not the other students who gave me a hard time, but the teachers. The way our classes were structured, I had the same 5 teachers for my two years there. My English teacher was british and must have had a personal vendetta against Americans because he took to correcting my pronunciation whenever I said anything in an American accent. He also marked off any time I spelled something the American way (example "gray" instead of "grey," "color" instead of "colour," "tire" instead of "tyre" etc) and so I had a difficult time making it through his class.
When I complained and said I needed good grades to get in to college, he simply said "If you colonials want to spell TYRE incorrectly you can do it on our own continent."
You see, it's a dirty aspect of human nature but whether you're American, Chilean, or European, people don't like outsiders.
Well, I don't like people who mistreat outsiders.
I've since grown up, and I've come to embrace my Swedish heritage, my height, my strength, my American spelling, and everything people tried to beat out of me when I was growing up. Those things are part of what make me who I am and I wouldn't give them up for anything.
I have a special place in my heart for Mexican migrants and for the immigrants in Europe who come from Africa and other places because I understand what they go through. I want so see them treated with dignity and I wish them the same success I have had.