It is basically shielding yourself and creating air flow. The following article did a study. Traditional Bedouin and Tuareg clothing is cooler than shorts or being naked.
The results of the study by Taylor, Finch, Shkolnik and Borut were decisive: the wide tunics cooled the air around the volunteer’s body, due to the tunics’ movement with the wind and their wearer’s movement. Its shape also produces a chimney effect, which makes the air rise, circulating between the fabric and the skin. The robes would even be cooler than going naked on a windless day, as they artificially produce airflow.
The authors also concluded that the typical Bedouin costume has the same effects whether it is black or white. The black color does absorb more heat, but it does not reach the skin, so the color of the fabric is not important. The thickness of the fabric of these garments also favors better absorption of temperature, preventing it from reaching the skin.
Charles de Gaulle mocked the Algerians for wearing them, but it looks like the rest of the world might have to adopt this technology in some fashion if things keep heating up everywhere.