The rules used to establish OSPF router ID on Cisco IOS are well known:
- Take the highest IP address of all loopback interfaces configured on the router when the OSPF process is started.
- If there is no loopback interface, take the highest IP address of an operating interface.
Most of these “wisdoms” are no longer true. For recent releases of Cisco IOS, OSPF router ID is a 32-bit value that has to be unique (that's all that the OSPF RFC ever asked for) and just happens to be taken from an interface address at the time the OSPF process is started. Even more, you can configure it to any value you like with the router-id A.B.C.D router configuration command.
The new behavior, while definitely making your network more stable, can also bring unexpected side effects: if you don't use the router-id command and misconfigure an interface IP address (resulting in duplicate router IDs), correcting the interface IP address will not fix the problem. You also have to reset the OSPF process with the clear ip ospf pid process command.