The European Economic Community was one step in a process of European integration that was begun shortly after World War II. The first of these steps was taken in 1951 with the creation of the European Coal and Steel Community. The point of this integration was to give Europe (mostly Western Europe at that time) a stronger economy and to decrease the chance of war between various countries of the region.
The idea behind the integration was that countries that were more economically integrated would not go to war with one another. They would already, in a sense, be parts of a single entity and would therefore not need to try to take one another's territory. It was also believed that more integration would strengthen the economy by creating a larger free market so that companies in one country could easily sell their goods all over Europe.