In recent years, ALICE has extensively studied the production of light (anti)(hyper)nuclei in different collision systems and center-of-mass energies. Nevertheless, the production mechanisms of light (hyper)nuclei is still unclear and under intense debate in the scientific community. Two classes of models are typically used to describe nuclear production: the statistical hadronisation model and the coalescence ones. In heavy-ion collisions, both models describe well the production yields of light nuclei and their ratios to the yields of hadrons, making it difficult to distinguish between the two. On the contrary, small collision systems, such as pp and p–Pb collisions, are ideal to study the (anti)(hyper)nuclei production mechanisms, thanks to the large separation between the different predictions. In this paper, recent results on light nuclei production measured with ALICE at the LHC in small collision systems are discussed in the context of the nucleosynthesis models, allowing us to exclude some configurations of the SHM and coalescence models in order to set tighter constraints to the available theoretical predictions.