Lightning Function
The air that comprises the Earth's atmosphere acts as an electrical insulator. This means that it does not readily conduct electricity. As thunderclouds travel through the air, the resistance they encounter creates a buildup of static electricity. This is the same principle that causes static buildup when you shuffle your feet across carpet while wearing socks. When the static charge of the cloud has built up to a substantial enough charge, the electricity will naturally try to even out with the nearest unequally-charged source. When lightning passes between clouds or between a cloud and a grounded object, the charge of the thundercloud is transferred into the object that the lightning strikes.
Tall Objects
Since electricity naturally tries to take the path of least resistance, the tallest objects beneath storm clouds are the most likely objects to be struck by lightning. This includes trees, buildings and other tall structures. Because of their closer proximity to the charged storm clouds, tall objects generally offer the easiest path for the electricity stored by a cloud to escape. For this reason, you should avoid standing near tall objects during a storm, and also avoid being the tallest object relative to your surroundings, such as by lying down if you are standing in a field.
Metal Objects
Metal is a conductor of electricity. This means that the composition of metal objects allows electricity to pass easily through the object. For this reason, lightning is more attracted to metal objects than to insulating objects. This principle can be seen at work in the function of lightning rods. Lighting rods are tall metal rods that extend from the top of a building. They are routed down the building and into the ground, such that they transfer the energy of a lightning strike into the earth. By placing metal lightning rods at an extended height relative to a building, lightning will be inclined to strike the lightning rod instead of the building itself.
Water
Depending on the impurities in water, it can increase the electrical conductivity of an object such as a human body. This risk is substantially increased when concerning a large body of water, such as a lake or ocean. Since bodies of water are flat, solid objects, such as structures and people that are in close proximity to the body of water, will be more likely to get struck by lightning. This is especially true if you are standing in the body of water, as the lightning will be inclined to use the height of the object to more easily transfer electricity into the uncharged body of water.