The purpose of roof flashing is to keep water out of your home. It is installed around openings in the roof and helps direct water away from these vulnerable areas. Also, it helps to prevent leaks.