>>31041800I wondered about this so I did some testing.
Had some random Pokemon turn up, so I decided to not leave any beans at all. Day later, still no beans left, the pokemon decided to stay.
On the flip side I've invested loads of beans ionto other visitors but they still leave.
I say it's all just random, OP.