Control of a situation.
If you are wondering who has the upper hand in your relationship, the next time you get up to fetch drinks, take a look on the sofa. There you will find that person.
This phrase originated with the advent of sandlot baseball. In order to determine which team would bat first, one player would grasp the baseball bat at the lower end. A player from the opposing team would then place his hand directly above the first player’s hand. They would alternate hands up the bat until the end was reached and one of the players had the upper hand.