The heat absorbed or released when a gas dissolves in liquid has essentially two contributions
1.Energy is absorbed to open a pocket in the solvent. Solvent molecules attract each other. Pulling them apart to make a cavity will require energy, and heat is absorbed in this step for most solvents. Water is a special case- it already contains open holes in its network of loose hydrogen bonds around room temperature. For water, very little heat is required to create pockets that can hold gas molecules.
2.Energy is released when a gas molecule is popped into the pocket. Intermolecular attractions between the gas molecule and the surrounding solvent molecules lower its energy, and heat is released. The stronger the attractions are, the more heat is released. Water is capable of forming hydrogen bonds with some gases, while organic solvents often can't. A larger amount of heat is released when a gas molecule is placed in the pocket in water than in organic solvents.