This is interesting field, and the freq scanning is left to phone vendors – and this is the game. Some start with the last freq used. Also in the SIM cards you have predefined roaming partners.
The procedure is first you camp on the cell then you check if the PLMN is allowed – if yes – register – if not – continue scan. Finally if the only PLMN is not allowed you have “emergency calls only”.