In Sophocles' tale of Oedipus Rex, Oedipus is abandoned as a baby because his parents, Jocasta and Laius, have been told by an oracle (fortuneteller) that their son will kill is father and marry his mother. To avoid this fate, the parents order a shepherd they employ to leave the baby exposed on the side of a mountain, where he will die.
The shepherd takes pity on the baby and delivers him to another shepherd, and eventually Oedipus ends up in the court of Polybus, the King of Corinth. The King has no children, and so he and his wife adopt Oedipus as their own. He has no knowledge that Polybus is not his real father.
After Oedipus has unknowingly killed his father, he solves the riddle of the Sphinx (a terrible creature that prevents people from passing in and out of Thebes) and becomes a hero. Since their king is dead (Laius), the people offer the throne to Oedipus, and Jocasta, to be his wife. (In this way the oracle's prediction comes true.)
When Polybus dies, a Corinthian messenger arrives in Thebes who delivers the news of Oedipus' adopted father's death, asks if Oedipus with rule the throne of Corinth, and explains that Polybus was his adopted father, not his natural father.