Just as Oedipus Rex was compelled to kill his mother due to a prophecy, it can be believed that children develop the same thoughts when addressing their own internal conflicts and desires for their parents. People, including children, are driven by instincts in order to keep themselves pleasured.
When Sigmund Freud (Freud) analyzed the ancient Greek myth, he connected his thoughts surrounding the Oedipus Rex myth, and applied many of the same principles to explain the development of children. As a result, Freud's idea was simple; children are compelled to love both parents, but attach primarily to one and fear the other. Out of that idea, the Oedipus complex was born.
The Oedipus complex, in its beginning stages described how a child (primarily a male) was just reaching a new stage in their life in which they discovered that there genitals brought them pleasure when touched. At the same time, the child then begins to have thoughts of his mother, which is a person that brings about pleasure through other means, such as food or affection. Out of fear of the thoughts that he is having, the child becomes consumed with the thought that his member, the penis, may be removed by his father due to the thoughts that he had about mom. Out of fear of the consequences, the child begins to connect with the father, in an effort to preserve his pleasurable thoughts about mom, while also keeping his member.