For any OSPF process to initialize, it must be able to define a router ID for the entire OSPF process. Once the router-wide data structures are built, it is then necessary to define the networks that the router will advertise and the area numbers into which these networks will be advertised.
If no loopback interfaces are defined, the OSPF process uses the numerically highest IP address value on an active physical interface. If no physical interfaces are active and configured with an IP address, the OSPF code will not initialize. In recent IOS versions, the router issues an error message if it cannot find a router ID. Older versions simply do not initialize OSPF.
If there is only a single loopback interface, its IP address will always be the router ID.