Flashing is basically metal that gets installed on a roof, usually the valley (the part where two planes of a roof come together) or over windows. The purpose of flashing is to direct water and protect your roof from damage in areas which can’t get water-tight shingles installed.
One of the weakest points of your roof tends to be flashing.
Flashing can be installed incorrectly, rust, peal up much like roof shingles, and more. If you have a leak and are wondering what to put plastic sheeting over, flashing is likely the best part to cover.
Additionally, flashing can be damaged by fallen branches and other heavy items. Also, areas which need flashing are often the valleys of your roof, which is the area most likely to build up damp pine needles or branches, and thus cause the flashing to rust. This is another reason to keep your roof clean.
So, overall, flashing is a very necessary part of your roof. If you see it looking worn or not quite right, get it checked out by a qualified roofer.