The word you're looking for is probably eavesdrop:
Secretly listen to a conversation.
‘my father eavesdropped on my phone calls’
(source: Oxford DictionariesLexico powered by Oxford Dictionaries)
@Zikato reminded me of this scene from The Fellowship of the Ring where Sam is caught eavesdropping (around 2:45) on a secret conversation between Gandalf and Frodo.