Franklin knew about electricity and that the build up of charges would release a spark. He thought these sparks were similar to lightning because they gave off light, were conducted by metals and moved quickly. Others had suggested lightning might be electrical as well, but no one had proved it.
Franklin's first idea, in 1750, proposed using an iron rod that extended 20 or 30 feet from a tower or steeple. Inside the building a man would hold a metal wire with a wax handle, so the man's hand would be insulated from the electrical charge.
Franklin never tried this, but in 1752 a French scientist did. During a thunderstorm, an electrical charge traveled down the rod and sparks jumped to the wire he held. This occurred without the rod being directly struck by lightning and proved that thunderstorms contained electricity.
Research doesn't indicate whether Franklin knew of the experiments in France when he flew his kite in 1752.
Attached to the kite was a metal wire that traveled to where he stood. At the end of the wire Franklin attached a metal key, and from the key to his hand was a silk string, which he thought electricity would not pass through. His theory was that the electricity from lightning would travel through the wire to the key, and a spark would pass through the few inches of air to his knuckle.
That is what happened, proving that lightning is electricity. Franklin may have been lucky, because the kite was not directly struck by lightning. If it had been, Franklin might have been killed. Several people imitating Franklin's experiment have been.
Another important invention came from Franklin's experiment. That same year, Franklin erected the first lightning rod to protect a building. We'll never know how many fires he prevented over the past 250 years. One last note: Twenty-eight years earlier, Benjamin Franklin had assembled the first fire company in the new world. He was, simply, amazing.