MOFs work by utilizing their porous structure to adsorb gases. The metal ions create a framework that supports organic ligands, forming a highly porous structure with a large internal surface area. The pores can be tailored to specific sizes, allowing for selective adsorption of certain gases. This makes MOFs highly efficient for storing gases like hydrogen, methane, and carbon dioxide.