Lightning simply striking the ground injects a huge current of up to 200,000A into the ground.
This current flows away from its point of entry into the ground. It does this through the most readily available conductive medium, the ground itself (soil, rock etc). However, the earth terminations and electrical cables of electronic installations are often better conductors of current than the ground itself.
This resulting current flows through the earth, neutral and phase conductors, as well as data lines which are connected to buildings further away. It flows through the electronics and electrical systems of the buildings closest to the strike point. As it does so, devastating transient voltages appear, causing damage to sensitive electronic equipment.