I’d say it’s vibes-based/comfort-level with the addressee. Which can only be understood thru immersion I believe.
I liked to joke with my coworkers and call them name-dono/-sama every now and then. I earned the coveted oniichan from only 1 of my coworkers.