DB or Trinity automatically put gems in stash 4. I never touched anything and my bot put every gems and mats in stash 4. If stash 4 is full bot will start to fill stash 3.
In my experience, if page 4 gets down to 2 slots left free the bot will then start dumping gems / materials into page 3. If page 3 gets down to 2 slots it'll do the same on page 2 and so on. It ends up being a big mess because you get 8 slots or more per tab that could actually stack but the bot looks for free space before trying to stack.
The best thing you can do is keep tab 4 clean by learning all recipies asap and perhaps storing leg crafting materials on a mule.
That is strange behavior. I've only ever had the bot stash in pages other than 4 IF 4 had only 2 slots free OR I hadn't purchased all the pages. Do you use trinity?
Well, the only difference in looting between Ghom and bounties would be the caches and key fragments. My guess is it's something to do with the caches. They are a tab4 stored item last I recall. It's possible the bot is stashing things in a strange order due to some interaction with the caches.