The principle is that different entities are good at different things, and increased trade allows them to find the thing they can do more efficiently than anyone else.
One person may be better at grinding flour, another may be better at baking bread. Rather than both people cutting grinding their own flour and baking their own bread, one person grinds the flour for them both, and one bakes bread for both, and both can benefit.
The same principle can be applied to larger groups, and to countries. Some countries may be good at growing food, others may be good a manufacturing machinery. They can trade machines for food, and both can benefit.
This is related to, but not the same as economies of scale.