If everyone who wanted to migrate were allowed to do so, the world would by one estimate be twice as rich.
^ This is a use of a conditional / past tense - it emphasizes the cause and effect. IF (everyone who wanted to migrate WERE allowed to do so, THEN the world would by one estimate be twice as rich. Despite conditional tense most often using the past tense conjugation of the verb, the sense of the condition is more ongoing - IF...THEN... in the past, IF...THEN... in the present, and IF...THEN... in the immediate future.
If everyone who wanted to migrate had been allowed to do so, the world would by one estimate be twice as rich.
^ This is a use of the conditional / past perfect tense. It emphasizes that an event (or in this case possibility of an event) did not happen in the past. The sense of this is totally in the past, there is not necessarily the implication that IF..THEN... holds in the present or the future.
This is confusing, especially because conditionals often mix tenses (notice the second clause has 'would be....'). So, one common we to think about this is "real" or "likely". We get four common conditional constructions:
0th Conditional: (present tense or past/present, makes prediction about "real" event that is valid ongoing / into the future)
If I drink coffee at night, I don't sleep well.
1st Conditional: (mixes present and future, makes prediction about "real" event just one time or "tonight")
If I drink coffee tonight, I won't sleep well.
2nd Conditional: (mixes past and future, makes prediction about "imaginary" event one time / tonight only)
If I drank coffee tonight, I wouldn't sleep well.
3rd Conditional: (mixes past perfect and past/present, makes prediction about "imaginary" event, refers to past only)
If I had drunk coffee last night, I wouldn't have slept well.
This is pretty confusing, and it's difficult to get the exact meaning of conditionals correct! So don't worry too much about it, you'll get used to it in time.
The first two quotes in this answer are 0th and 3rd, by the way!