The population of Wales grew by about 23,000 as a result of net international migration in the year to June 2024.