That's definitely a part of it. When everyone was crapping all over tariffs in general after the Trump tariff debacle, I was arguing from the left that while Trump's trade war tariffs obviously sucked, the idea of tariffs on countries with lower labor conditions in order to make domestic workers with better pay and labor protections competitive is actually sound. If you don't provide any penalty for undercutting labor rights and practices you'll just get outcompeted in a market economy. And it also disincentivizes export countries from undercutting their labor, hopefully improving labor rights there.
Not only do we have undercutting of labor, but there's also the exporting of industries with lots of negative externalities; we crow about reducing mining, or drilling, or lumber production, but we just buy those things from other countries anyway. A lot of those industries tend to be rural by nature as well.
That said, that kind of "race to the bottom" with labor conditions has hit urbanites pretty hard, too; lots of cities that were founded on heavy industry like car or steel production, manufacturing in general... unfettered globalization has hit all lower and middle classes hard.
I think though with rural communities, a big part of it is we've just become so efficient and reduced labor needs so much, especially in industries like farming, that small communities which are much more vulnerable to big population shifts in the first place, just die out. When you go from needing dozens of farmhands per farm, more during harvest, to only a few and a combine... small communities just can't absorb that kind of population shift the way a city that's more diversified can.
So for some of these villages, I just don't think there's any coming back even if we did have strong labor laws and some protectionism for that domestic labor (which we absolutely should). You'd have to purposefully go back to less efficient farming methods, which has some pretty big implications for a population size that's since far outgrown that kind of output. Those villages just aren't coming back in nearly any conceivable circumstance, I think, and there should probably be incentives to move people out of them and let them die out.
Frankly, for those small communities that don't have any prospects for growth, I think some thought should be put into actually helping them along in closing down, moving residents out to more living communities, and rewilding the land they once sat on.