King Laius was warned by an oracle that his son would kill him and marry his wife so they have a servant tie Oedipus to a tress and leave him there to die.
The servant was unable to leave the child like this so he gives Oedipus to a sheppard who then takes him to the house of King Polybus, there him and Queen Merope adopt Oedipus as there own and raise him.
After several years of living with the King and Queen Oedipus discovers that he is not there son. He tries to confront them but they deny everything. He then procedes to consult an oracle where he is told the same prophecy as him biological father. After hearing this he decides to leave Corinith and travel to the city of Thebes in hope to avoid the prophecy.
On the way to the city of Thebes Oedipus crosses paths with a King named Lais, they get into an argument and Oedipus kills him as an act of self defense not knowing this man was his biological father. Prophecy is being fulfilled.
As he continued on his journey to Thebes he comes across a Sphinx outside of the city. The Sphinx ask everyone a riddle to come through and Oedipus answered correctly and was allowed to continue on his journey.