Hi I have been playing a bit of poker and although i know the odds for certain hands such as AK vs QQ etc i was curious about the maths behind these odds.

lets say if my opponent flops top pair but i have two overcards. with the turn and river to come who is the fave. or say if my opponent flops two pairs and I have nut flush draw with two cards to come who is the fave. or say u have one overcard vs pocket pairs.

how is the maths behind all these worked out? Thanks in advance. Just like to know if im the fave when im putting my money into the pot