Apple Store iPhone Repairs – Does Apple need me to unlock my phone?

So I managed to crack my brand new iPhone’s display within weeks of getting it – but thankfully I bought Apple Care so the repair will only cost a few extra dollars. Anyway, while I was booking an appointment for the Apple Store, I remembered one of my previous visits there, where a worker needed me to unlock my phone so that she could diagnose a problem with the charging. She then took my unlocked phone to a presumably staff only section of the store, well out of my sight.

Just wondering is this common practice to have your phone exposed and unlocked for the Apple Store workers each time you bring your phone in? What’s stopping her from trolling through Messages or Photos? And why would Apple prefer me to have a backup of the phone beforehand – like what are the chances of me losing my data after an Apple Store visit anyway? Thanks.