What's the connection with lightning rods and static electricity?

Lightning, of course, is simply a huge discharge of static electricity. In its nature, it's no different from the spark from your finger to a doorknob; the difference is only in scale. The current flow is from the sky to the earth (or earth to sky depending on how you view it technically, which is immaterial to this discussion), via the path of least resistance--which for a number of reasons, is not always the shortest, or straightest. The air is a relatively high resistance medium, so the lightning will "prefer" most any solid object, such as house, tree, or human body. The current creates an enormous amount of heat in whatever it passes through, and this is generally what causes the problem, e.g., fire, explosion, etc. Thunder, like the "crack" you hear when your fingertip discharges to the doorknob, is the sound of superheated air expanding explosively. A living body, of course, like electronic devices, is further disrupted by the presence of the voltage/current itself. A lightning rod, then, is simply an effort to offer the discharge an easier path than through an object which might be damaged or destroyed by it.