because it's extremely fertile land with a warm climate. people forget humans aren't meant to live outside of a few areas, and our populations reflect it. it's a lot harder to freeze to death in these two countries than europe or the americas. add to that their societies have existed for 4-5k years so there's almost no unexplored wilderness or unpoplulated areas while the population built up more and more settlements over thousands of years. if you look at the countryside of both nations, there is a density of small villages that doesn't exist elsewhere. i'm talking a walled village and then a few hundred meters another one. without any major collapse like the bronze age collapse destroying these settlements, you get the two population powerhouses in the world.
Canada