There are two different reasons you leave your country:
1. You wreck your country yourself and then leave.
2. Your country gets taken over by a different group who wrecks it so you have to leave.
Let’s break down number 1:
If those in power are not persecuting you because you have a different religion or ethnicity then you are not being persecuted in a way that justifies leaving. Sure, you might have a different political ideology and be persecuted for that but that is not an excuse to leave. Throughout history people have had to deal with persecution by those in power who were ethnically and religiously the same as them but who had different political ideologies and the solution to building a great country was not to leave but to overthrow those in power at great human cost. In fact there are very few great countries that have not had to take this route at some point. So if you choose not to go that route and leave instead, you fall into the category of “you wrecked your own country” and left.
Number 2 is a little more difficult.
If you are going along perfectly well and have built a great country and you get invaded and/or taken over by a different ethic or religious group that persecutes you on this basis and then wrecks your country, you get a free pass. History seems to show that when a country is divided along ethnic or religious grounds there is little hope for the group in the minority. Often the solution has been partition and the creation of separate countries. This gives each group the chance to prove that their policies/culture/religion (whatever) is better and history is the judge. If there is no partition then the minority often has had to leave to survive.
While this is a complex issue and this post is too simplistic to cover every nuance, it is simply a fact that great countries are rebuilt after a lot of death and suffering took place to change the regime by the majority.
Great countries cannot be rebuilt when the majority of young people leave. Old people don’t rebuild countries.
Warning, controversial take:
When people arrive in a country because they had a great country but it was wrecked by someone else (invader or whatever) which rendered them a minority, they tend to add a lot of value to their new country. That is, they pick up where they left off. Conversely, when people arrive in a country having left a country where they were part of the majority (religiously/ethnically) and their government wrecked their own country or they never build a great country in the first place then they tend to cause problems in their new country too. That is, they pick up where they left off.
This is similar to CEO’s that come in a wreck a company that was doing well. They soon leave and often bring the same poison pill to the next company they work at. Conversely, if a great CEO is fired due to being politically outmanoeuvred they tend to add huge value to the next company they work at. That is, they pick up where they left off.
Not an absolute rule of course and there are significant exceptions but there is certainly an argument that this is true on average.