what is the meaning of the idiom turn the tables on?
to change a situation so that you now have an advantage over someone who previously had an advantage over you: She turned the tables on her rival with allegations of corruption.