I guess the word 'betray' has duality in terms of the meaning.

When sombody betrays their belief, they go against their belief.
In the other way, when somebody betrays their emotions, they go for their emotions.

How this single word can have these conflicting meaninigs ?
Is there any origin or reason for that?

Always thanks for your answer.