There is growing focus on the crucial task of effectively capturing carbon dioxide (CO2) from the atmosphere to mitigate environmental consequences. Metal-organic frameworks (MOFs) have been used to replace many conventional materials in gas separation, and the incorporation of ionic liquids (ILs) into porous MOFs has shown promise as a new technique for improving CO2 capture and separation. However, the driving force underlying the electronic modulation of MOF nanostructures and the mechanisms behind their high CO2 adsorption remain unclear. This study reports the effect of encapsulating different imidazolium ILs in porous ZIF-8, to clarify the adsorption mechanism of CO2 using density functional theory (DFT)-based approaches. For this purpose, a range of anions, including bis(trifluoromethylsulfonyl)imide [NTf2], methanesulfonate [MeSO3], and acetate [AC], were combined with the 1-ethyl-3-methylimidazolium [EMIM]+ cation. [EMIM]+-based ILs@ZIF-8 composites were computationally investigated to identify suitable materials for CO2 capture. First, the intermolecular and intramolecular interactions between [EMIM]+ and different anions were examined in detail, and their effects on CO2 adsorption were explored. Subsequently, the integration of these ILs into the ZIF-8 solid structure was studied to reveal how their interactions influenced the CO2 adsorption behavior. Our results demonstrate that the incorporation of ILs strongly affects the adsorption capability of CO2, which is highly dependent on the nature of the ILs inside the ZIF-8 framework. DFT simulations further confirmed that the incorporation of ILs into ZIF-8 led to superior CO2 capture compared to isolated ILs and pristine ZIF-8. This improvement was attributed to the mutual interactions between the ILs and ZIF-8, which effectively fine-tuned CO2 adsorption within the composite structure. This understanding may act as a general guide for gaining more insight into the interfacial interactions between ILs and ZIFs structures and how these molecular-level interactions can help predict the selection of ILs for CO2 adsorption and separation, thereby addressing environmental challenges with greater precision and effectiveness.