Play both ends against the middle
Idiom

To make two people or groups oppose each other so that you can gain/get an advantage from the situation.
Politicians often play both ends against the middle by bringing up religion into the politics.

Synonyms: Work both ends/sides against the middle.