Embedding php in html VS generating full pages?

Title! :slight_smile: Which is more efficent or prefferable?

Do most websites generate the html for the header and footer? Or is only the content pulled out of the database?

I know how to do it either way… Just wan’t to know whats better!