HA Master election is actually done by doing a few simple checks, the first one is the greatest number of datastore a hosts has mounted. If multiple hosts have the same number of datastores, the next criteria - the highest Managed Object Id - comes into play. See "Election" at https://ha.yellow-bricks.com/fundamental_concepts.html
André