During recovery, system databases are recovered first. Then, user databases are recovered in order by database ID.