The creation of the Parliament of Europe is one of the pivotal moments in the history of European Integration. It is a massively complex topic.
I wrote about a general overview on the EU here, and also wrote a longer answer on the early impetus for the creation of a unified Europe here as well as another answer on the hiccups the system ran into in the 1980s. None of those answers really address the creation of the European Parliament, but they might give you a general overview through which you can narrow down your question into something that is easier to answer.