It’s weird because in these settings a successful settlement is usually portrayed as basically impossible for the zombies to break into. Then, somebody has to do something stupid to let them in. Movies where things fall apart despite nobody making an obviously stupid mistake are a lot more satisfying IMO.
expanding is done when the fields get too far to walk there and back in a day. Then you make a new village.
more likely you practice what birth control you can to limit population. Your other choice is go to war and kill some other village so your kids can move there. There was essentially no unclaimed land you could expand into.
An interesting take on this is depicted in Attack on Titan, where they do in fact wall all the fields - the city (I don't remember if it's like the last vestige of humanity or whatever) is surrounded in concentric ring walls, the outer one which contains villages and farmland having a circumference of about 3000 kilometers for an internal area of 723,822 km², making its area just a bit smaller than Zambia and Chile.
Of course, a 3000 kilometer, 50 meter tall wall is ridiculous. But then again the great wall of China is 21.000 kilometers long. I believe there's more info about the walls and their construction in the source.
Cities can only pull off a large population if there are a lot of villages growing surplus food (which is not what the village wants - in the medieval world cities were not making luxury goods farmers wanted so farmers would want to work less), and cities needed good bulk transport for all that food. Rome was a massive city in the day with just over a million people - today that is considered a tiny city and there are many much bigger.
North America had vast empty forests - but remember just before Europeans arrived disease (small pox) killed large portions of the population. We have very little recorded about what life was like before Columbus, but archeological evidence suggests that the land was already used to the max capacity of their technology. (Europe did bring technology to better use the land - for some definition of better. I'm not qualified to comment on why they didn't develop the technology, but there seems to be some interesting culture factors - perhaps you can find an expert)
And then something like The Expanse comes out and it turns out that realism is actually really interesting. Sure, the space is unfamiliar realism, but so is serf life to most viewers. And direction is also very important.
Anyway, you mention Space Marines, there's animations and lots of media about them. Some depicting them as basically invulnerable (like the 40K episode of Amazon's Secret Level), but plenty of them where they die en masse - because while they're super suits, they're up against the worst the universe can throw at them (like the British).
This comes from it fundamentally being small scale skirmish game. So realistic army sizes are not possible. And on other hand you need some level of game balance. You can't expect one side to have dozen models and other to field thousands or tens of thousands.
And even there. Considering stated population of any reasonably build world to be in billions and more populated to go to hundreds of billions. Number of normal humans you could stick a weapon in hands and told to shoot at that direction would still be in at least millions if not billions. A few thousand whatever can do very little against that.
Maybe it was Interstellar.