The main results refer to the spatial distribution and the motion of populations of stars with different median ages across the Large and Small Magellanic Cloud (LMC and SMC) as well as to the determination of the amount of dust present inside the galaxies. Results were disseminated via research publications and presentations at international conferences. We selected stars based on their observed flux within near-infrared filters and attributed ages to them from the comparison with the flux predicted from models of stellar evolution. We explored ages from a few million to several billion years and we distinguished between stars of the Magellanic Clouds and stars of the Milky Way along the line of sight. We produced maps of the spatial distribution of the Magellanic Clouds’ stars within the smallest bins to date that outline the morphological features of the galaxies most likely associated to dynamical interactions. In the SMC, the predominantly spheroidal shape traced by the old stars contrasts the triangular shape traced by young stars. In the LMC, young stars trace coherent structures, multiple spiral arms and clumps. Whereas older stars are overall more regularly and smoothly distributed. We also studied groups of young stars and characterised over 2500 of them, at different levels of significance, that range in size form a few to over 1 kpc. We derived other parameters such as surface density, number of stars, crossing time and velocity dispersion as well as relations among them which indicate that the fractal nature of these structures was probably inherited from the gas clouds from which they formed and their architecture was most likely generated by supersonic turbulence. Furthermore, by accurately measuring the tangential motion of stellar populations within the central regions of the SMC we identified not only an overall flow motion towards the Magellanic Bridge but also a dynamical feature behind the core of the galaxy. In the centre of the LMC we found that intermediate-age/old stars follow elongated orbits whereas young stars move instead along the filamentary bar structures. We measured the tangential motion also for stellar populations of the Magellanic Bridge. There the stellar density is not very high and to remove the influence from Milky Way stars we complemented near-infrared observations with distances obtained from the Gaia mission, currently charting the sky and providing accurate coordinates and distances. We developed a machine-learning-based method to distinguish between Magellanic Clouds and Milky Way stars in the outer regions of the LMC. There we found that stars in the south east of the galaxy rotate slower than the overall rotation, which could be due to a fraction of SMC stars present in the region that move opposite to the expected rotation. Finally, we developed a method to quantify the total dust content of the Magellanic Clouds. Accounting for dust is one of the main uncertainties influencing most studies that use the observed flux of stars. In our method we used distant galaxies observed in the background of the Magellanic Clouds. We combined the most sensitive optical and near-infrared imaging observations of the LMC and SMC stars and accounted for the several components of dust along the line of sight: the dust within the Milky Way, the dust between the Milky Way and the LMC/SMC, the dust within the LMC/SMC, the dust between the LMC/SMC and the background galaxies, and the dust within the background galaxies. We obtained dust maps consistent in part with previous determinations using other methods and in part highlighting discrepancies likely associated to different tracers.