When I click and delete a message, how does Mail.app decide which to select next?

Solution 1:

When you click with the mouse button on an item directly above or below the currently selected one, Mail behaves the same way as it would with the down and up arrows on the keyboard.

When you hit the down or up key to select the next item in the list, Mail is programmed so that it remembers your "working direction". Which means when you move the selection one item downwards and delete that item, the selection moves to the next item below the currently deleted item. So this also happens when you click with the mouse on the first item below the currently selected one, which is the case in your video.