Origin: "pound sand"?

I can confirm that rats do live in holes. My neighbor has chickens and a dog. We have no dog. Thus, the rats that eat his chicken feed live in my yard. Those guys dig like there’s no tomorrow. (I have even heard unconfirmed stories from other neighbors that rats can do so much digging that they can undermine a house’s foundation.) It takes a steady effort to continually poison them, but we also fill in the holes, so that any new rats won’t discover pre-made holes just waiting for them to move into.

So… I can actually say that this version of the saying makes some sense, though it’s never the sense in which I’ve interpreted it.

I always thought it referred to military forces marching through the desert (closest to the OPs #1 interpretation). In my understanding, it’s not just “walk away” but also the ideas that a) walking on sand is very tiring b) sand is in deserts and deserts are miserable c) lots of military forces have been killed by deserts (dehydration, etc.) and d) it’s probably pointless to conquer a desert anyway.

The idea of pounding sand up your ass just makes no sense to me… but I suppose that doesn’t rule out that possible origination.