The presence of alkali residue in solar energy systems is primarily caused by the interaction between water and the materials used in the system. Hard water, which is high in minerals, plays a significant role in residue formation as it leaves behind deposits when it evaporates.