What exactly is the purpose of roofing felt or roofing underlayment?

Roofing felt or roofing underlayment is an important part of the roofing project.

Roofing felt or roofing underlayment is intended to be used on the bare roof deck under the roof covering material (shingles, for example). Among other things it provides back-up protection in case of a shingle blow-off, and during the installation of the shingles it can keep the not-yet-shingled deck dry.