There’s a long tradition throughout Europe of statutes requiring hotels to collect information on guests—including name, nationality, and ID number—enabling law enforcement to cross-check for wanted individuals, criminals, or missing persons. The European Union has since made such data collection a requirement for hotels in member states. Most of this information is simply stored to be made available to authorities upon request, though in certain areas (notably Italy), it is regularly collected. In the past, some hotels would hold guests’ passports for hours or even overnight to manually complete the registration process. Today, you usually just have to show it at check-in.