In many countries in Europe it is a legal requirement to verify and record the indentity of all foreign residents staying in hotels, and record the details of their ID document. If you entered this (passport No. etc.) online when you booked, they just check your ID is the same at check-in.