a key: the tool that locks and unlocks a door, and so the sign of who has the right to let people in or shut them out
In the ancient world a key was nothing like the small metal object on a modern key ring. It was commonly a wooden or iron bar fitted with pegs, large enough that a household steward could carry it on his shoulder in plain sight. Whoever held it held an office, and everyone could see who that was. So the word moved easily from the tool to the standing it represented: the person with the key decides whether the door opens.
All six New Testament uses work that way, and none of them describes anyone unlocking an actual door. What the picture controls is access, and it turns in two directions, because a door keeps people out and also keeps people in. The kingdom of heaven, knowledge, and the house of David are places you want to get into. Death, the grave, and the pit are places you want to get out of. One word covers both, since both come down to the same question: who holds the door.
Revelation 3:7 works straight from Isaiah 22:22, where God takes the key of the house of David (מַפְתֵּחַ) away from one steward and lays it on the shoulder of another, who then opens with no one able to shut and shuts with no one able to open. Set beside the Greek word for authority (ἐξουσία), which names a right in the abstract, this word names the thing you can see and hand over. It is the noun that belongs with the verb "to shut" (κλείω), so it keeps a real door in view even when the door is the entrance to a kingdom.
Nuances
What the keys of the kingdom in Matthew 16:19 authorize: admitting and excluding persons, or declaring conduct permitted and forbidden.
- contestedThe keys are the steward's authority to admit or exclude, following the image in Isaiah 22:22 of the key laid on the shoulder of the household manager.; TDNT, s.v. κλείς (Joachim Jeremias)
- contestedBinding and loosing is the rabbinic idiom for declaring conduct forbidden or permitted, so the keys stand for authority over teaching and the interpretation of the law.; Ulrich Luz, Matthew 8-20 (Hermeneia), on 16:19