If the UK dropped its tariff and non-tariff barriers to trade we would get cheaper goods and (mostly poor) foreigners would become slightly richer.
As we are in the EU we do not handle our own trade affairs. Facing inward towards Europe we practice free trade, facing outwards Europe has erected barriers against all sorts of things, from bananas to bras.
If the UK left the EU it could unilaterally drop its tariff barriers in a rerun of the 19th Century. All else being equal, Third World producers get a larger market and become wealthier. This is an advantage of leaving the EU.
But if the aim is to increase the welfare of humanity in general, then leaving the EU and going all William Cobbett might not be the best method.
The UK is a large economy, but it is much smaller than the EU. If the UK’s membership of the EU helps maintain a slightly freer trade regime then staying in “Fortress Europe” may be better for mankind’s welfare than leaving.
Not by any means a perfect situation but it is a scenario that should be taken into account in discussions of the UK’s place in the world.