to pull something out by the roots: to grub a plant out of the ground, or to tear a town out of its place for good
When a farmer pulls a plant up, the roots come with it. That is the picture here. This is not cutting a stalk off at ground level, which leaves a stump that can sprout again, but taking the whole thing out of the soil so that nothing is left to grow back.
Ecclesiastes uses the word in its plainest setting, pairing it with planting inside a long list of opposites that together cover the whole of a life. Zephaniah stretches the same picture over a city, because a town can be torn out of its place as thoroughly as a vine out of a field. Hebrew has a weightier word for that kind of judgment, and the prophets usually reach for נָתַשׁ when they announce that God will pull a nation out of its land. This word stays closer to the garden.
The same image lies behind the related adjective for a woman or animal that bears no young (עָקָר): a family line pictured as cut off at the root, with nothing growing up from it.