It provoids information to the windows loader on how to manage the executable code wrapped inside.
DOS header : to validate and exeute in the dos tub. PE header : contains lot of information like location of the code in memory, the size of the code,etc. Optional header Sections table