How do multiple action context with same action mapping exactly work?

Hi. I’ve recently started using enhanced input system. What I’m curious about is how does the system exactly work when I have same action assigned in multiple input mapping context. How do I bind this action to different code based on mapping context, or how do I know from C++ that this action was triggered from this mapping context so I can execute different logic?