It is quite obvious that the gains from trade are positive, but implementing a free trade agreement obviously also implies some losses, in particular for workers whose skills were locked into the industry that just opened up. The implementation of some free trade agreements includes some compensation for such workers, but it is not much used if available. Why? And why would we need such compensation schemes at all?
Indeed, Marco de Pinto points out that unemployment insurance fulfills this role remarkably well. Those who benefit the most from the free trade agreement, and work, contribute to it, while those who lost, and are unemployed, receive insurance benefits. And if the unemployment insurance is not actuarially fair, that is OK, as it corresponds to a side-payment to the losers (no pun intended). But of course, the necessary taxation is distorting to the point of destroying the gains from trade. In such a context, it appears to be better to finance the unemployment insurance with a wage tax, as it neutral on all markets, in particular because under unionized labor markets, after tax wages are unchanged in aggregate. A profit tax is worse, but better than a payroll tax because it does not reduce labor demand for low-skilled workers as much.