Comparing hydrodynamical simulations with observations is becoming increasingly important for understanding the physical processes that govern galaxy evolution in the era of JWST and ALMA. In this talk, I will introduce SKIRT, a versatile radiative transfer code developed by our group, for which I implemented the non-LTE line radiative transfer module. As a first application, I will present new radiation-hydrodynamic simulations of AGN tori that self-consistently incorporate non-equilibrium chemistry, XDR/PDR heating and cooling, and dust destruction under AGN conditions. These simulations reveal how AGN radiation and supernova-driven turbulence shape the gas distribution and chemical abundances on scales of tens of parsecs. As a second application, I will present synthetic UV-to-millimetre observations of galaxies at z=3-8.5 from the MEGATRON cosmological simulations, generated with SKIRT. I will discuss how star formation and stellar feedback shape far-infrared (FIR) emission lines such as [O III] and [C II], and explore the physical conditions responsible for the strong ionized emission observed in high-redshift galaxies.