The swelling of hair in humid air is due to the hydrophilic properties of the hair shaft. Hydrophilic materials, such as hair, have a strong affinity for water molecules, and this affinity increases with relative humidity. When the relative humidity is high, the water content of the hair shaft increases, causing the hair to swell and curl.
Another reason why hair curls in the summer is due to changes in the hair's hydrogen bonds. Hydrogen bonds are weak chemical bonds that form between the oxygen atoms in the water molecules and the nitrogen atoms in the amino acids in the hair shaft. These hydrogen bonds help to determine the shape and structure of the hair. In humid air, the water molecules can break these hydrogen bonds and form new ones with the amino acids in the hair shaft. This change in hydrogen bonding can cause the hair to become curly and frizzy.