hold all the aces

Meaning 1
An ace is the highest card in each suit. To hold all the aces gives one a distinct advantage.
Sentence 1
They scored a grand slam in bridge last night. Her partner held all the aces.
Meaning 2
to have an advantage
Sentence 2
After the Second World War the United States held all the aces in developing a space program and advanced nuclear technology.