system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What does having a key to a city mean?
gpt
Back in medieval times, cities had walls, and the wall gates closed down every afternoon and opened every morning. Travellers arriving after the gates had closed had to stay the night outside them in some inn. 

Giving somebody the "key to the city" meant that you recognized that person's importance and you considered him trustworthy enough to allow him free passage whenever he chose (he had his own key, in a symbolic sense, to open the gate even through the night). 

Nowadays it's just an honor, it doesn't hold practical value.