They get a ton of tax incentives, subsidies, etc to build shoddy infrastructure that can only be used for big box stores (pretty much), so the end cost for Walmart to build their stores is quite low.
They promise to employ lots of locals, but many of those jobs are intentionally paid so low that they're not actually living wages and employees are intentionally driven to government help (food stamps, etc), and together with other various tax cuts, etc, there's a chance that even their labor costs are basically at break even.
Integrated local stores are better for pretty much everything except having a huge mass to throw around and bully, bribe (pardon me, lobby) and fool (aka persuade aka PR/marketing).