Interactions between natives and foreign-born individuals may help to stimulate the development and the diversification of bilateral trade relationships. In fact, migrants act as trade facilitators reducing transaction costs in export activities and, consequently, more local firms are able to establish new trade relationships abroad. The pro-trade effect of migration is well evidenced in several works where the shape of the trade-migration relationship has been examined empirically; however, they all lack an analytical model that enables them to predict the expected non-linear relationship between migration and trade. Here, using statistical mechanics tools we develop a simple model that demonstrates that there is a positive non-linear relationship between the extensive margin of trade and the proportion of migrants in the total population. Data on Spanish trade and migration provide support for the predictions made by the theoretical model. The model also suggests the need of a critical mass of migrants before their interactions with the natives have any effective impact on trade. The threshold is sensitive to the nationality of the migrants, suggesting that cultural differences between natives and migrants may affect the number of migrants needed to generate a positive impact on trade. Furthermore, we examine the possible relationship between the share of migrants in the total population and the extent of diversification of the portfolio of exported goods, finding evidence of a strong positive correlation. Our approach can be used to examine other related issues such as the impact of formal or informal firm networks on trade.