Economic integration results in trade creation and trade diversion. Trade creation leads to advantages while trade diversion is not desirable from an economists point of view.
Trade Creation
Trade creation takes place when domestic consumers in member countries import more goods from other members as import prices fall due to a removal of tariff and quotas; production will shift to lower cost producer.
In the above diagram, when Thailand and Malaysia form a trading bloc, Thailand will remove tariffs from Malaysian imports. Trade will go to more efficient Malaysian producers. The blue shaded regions shows that world efficiency wil be regained as now more efficient producer is producing the good and there are lower prices which lead to regaining of consumer surplus.
Increased income resulting from specialization & benefits of scale can further this by creating increased demand for imports from non-member countries.
Initial effects are the increase in consumer welfare resulting from more goods and lower prices, while the long-run effects include enhance competitive advantage and increasing specialization.
Trade Diversion
When a customs union is created and tariffs differentials between members and non-member result in trade flows being diverted toward higher cost producers.
In the upper image, once the UK joined the EU, it had to place tariffs on the Palm Oil that it used to import from Malaysia at lower prices. The trade now is diverted to EU nations inspite of the fact that they are inefficient in producing palm oil.
The blue shaded regions show a loss in efficiency due production by inefficienty Europeon producers. Morever, the prices for consumers have increased from from Pm to Peu which results in loss of consumer surplus.
In other words, lower cost imports from outside the union have been replaced by high cost imports from within the union.