How is the rotation axis determined for camera orbiting?

I’m having trouble understanding how the rotation axis is determined when orbiting the camera with two fingers on the track pad.

It seems to change depending on the cursor position, and maybe also the cursor’s position in relation to the model, but I can’t figure out the logic.

There seems be none. I have been asking for constraints for orbiting to add some control to it. Not sure if they are listening.

The rotation of the camera is based on the center point of the initial viewport.

And when your center point goes off screen it now orbits around the new center point.