The answer to this lies in the loot respawn mechanic.
Currently, loot respawn happens after X amount of days away from an area with an empty container.
This means that if you empty a container with a 30 day loot respawn in an area you wander through all the time, it will never respawn, as that 30 day timer will constantly be being reset.
If you plan on carefully keeping track of where you've been, in order to only return X+1 days later (so, 31 days later in the above example), then emptying the container completely will save you a bit of time in being able to right away see that the container is freshly full of loot to be looted again.
Here's where it gets weird though:
If a container has been opened, but is not empty, Its respawn timer will not be reset. As long as the container isn't completely empty, the game will only track time from when you last opened the container. BUT the container will not actually respawn until it is empty. Confusing? This should help:
I open a working stiffs box. I take the tools, but leave 1 frame in it. 31 days later, if I open that box, the frame will still be there, but the loot timer says its ready to refill, so I can take the frame out, close the container, and before my very eyes, the container will refill and be marked "untouched" and ready with fresh, new loot. This works no matter how many times I've been walking through the area in those 31 days (unlike an empty container, which would reset the 30 day timer back to the start every time I came near that world chunk).
A habit of some players is to "seed" valuable containers with a junk item. Very common in bookstores pre-A17 for the schematics, but even in A17, you can use it in bookshelves for new mod schematics and paper, gunstore boxes, working stiff boxes, safes, etc. The method here is that when you loot the container (that you deem valuable enough to bother remembering to return after the respawn timer), loot it, then drop 1 of a junk item (like a plant fiber or something) into the container. 1 day after your respawn timer should have run out, if you return and remove that plant fiber, the container will refill upon exiting the looting screen. Be careful to make sure the whole loot timer has run out (maybe use map bookmarks with what in-game day you looted an area?), because if you empty the container out before the timer is up, it'll reset the timer, and there is no way to know the timer is up UNTIL you empty and close the container!
In short, "seeding" containers takes a bit more work, but will ensure that loot respawns reliably in case you happen to be wandering nearby. Completely emptied containers will respawn just fine as long as you steer clear of their general area until they respawn. And containers will not show that they've refilled UNTIL they've been emptied.