play both ends against the middle
Also, play one off against another. Gain an advantage by setting opposing parties or interests against one another. For example, Some children are adept at manipulating their parents, playing both ends against the middle, or Aunt Jane had a nasty habit of playing the twins off against each other. The first term may come from a cheating practice used in faro. Minute strips were cut off certain cards, so that one could tell where they lay in the deck. When the cards were cut convex or concave, it was called "both ends against the middle." The figurative use of the term dates from the first half of the 1900s. The variant originated in the mid-1600s as play against one another, with off being added in the late 1800s.