The Large and Small Magellanic Clouds (LMC and SMC, respectively) are the nearest interacting pair of galaxies and their physical properties have been observed in great detail. However the origins of the two galaxies are poorly understood. In this project, a number of key unresolved problems related to the LMC and the SMC are explored using fully self-consistent numerical simulations with star formation and gas dynamics. In particular, the formation processes of the Magellanic Stream, star formation histories of the LMC and the SMC, hydrodynamical interaction between the Clouds and the Galactic gaseous halo, and formation of molecular clouds in the Clouds are extensively investigated by numerical simulations. The results are compared with the corresponding observations obtained by radio and optical telescopes here in Australia.