Welcome to the Zoom Community, @Gallowglaze.
There was confusion about the order in the Participants window at one point, and I did some definitive testing which I passed on to the Zoom documentation team. They updated this document about a year ago using my results:
https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0065566
The Gallery View is not sorted the same way as the Participants list.
Gallery View order can be affected by a number of factors, but if no manual modifications have been made to the Gallery View, Raised Hands are stacked left to right starting in the top/left box going to the right in order of when they were raised, with the “oldest” first and most recent last. Taking a hand down and immediately putting it back up still puts you back at the end as the most recent, even if you were in square 1 before lowering your hand.
I don’t have a definitive answer about how the remainder of a Gallery View is sorted by default.