How did Oedipus become king?
When the Sphinx posed the riddle, "What is it that walks on four
feet and two feet and three feet and has only one voice.
When it walks on most feet it is the weakest?". Oedipus correctly said "Man" and became King of Thebes.
In addition to solving the Sphinx's riddle, he also married Jocasta, which further guaranteed his place as king.