Underlayment adds a secondary moisture barrier beneath shingles
https://wiki-global.win/index.php/Roofing_Materials_Explained_by_way_of_Mid_Atlantic_Roofing_Systems_Inc_51050
Underlayment gives you a secondary moisture barrier beneath shingles, making improvements to climate resistance and safeguarding the roof deck from leaks.