Supposedly the higher the level of the pet you are battling the higher your chances, regardless of your pets level. Also the stone that drops from the battle is supposed to match the type of the primary pet (the one you clicked on). RNG does play a factor in this and it can be of a different type. Just a couple of my own examples of this.
I was in dragonblight farming condor hatchlings for a rare and got 1 flying stone in about 2 hours of battling.
In Jade Forest I farmed serpent hatchlings until I got a dragon stone to use on Emerald Whelpling, took about an hour and a half.
I was in Krasarang Wilds farming Jungle Grubs (looking for rares and leveling pets) got extremely lucky and got 2 BoE stones in under an hour. But spent next 2 hours with nothing.
Funniest one is when I got a flying stone off of the trainer in Moonglade. It came from the battle and not the bag as I checked and saw it in my bag before I turned in the daily and got the supply bag.
These are just my examples and not a definitave answer to how they drop. I also have bad luck with stones most of the time.