Within a combined approach we investigate the main features of the production of hyper-fragments in relativistic heavy-ion collisions. The formation of hyperons is modelled within the UrQMD and HSD transport codes. To describe the hyperon capture by nucleons and nuclear residues a coalescence of baryons (CB) model was developed. We demonstrate that the origin of hypernuclei of various masses can be explained by typical baryon interactions, and that it is similar to processes leading to the production of conventional nuclei. At high beam energies we predict a saturation of the yields of all hyper-fragments, therefore, this kind of reactions can be studied with high yields even at the accelerators of moderate relativistic energies.