Layout files are very important for your theme because every other template file is rendered inside the active layout. There is only ever one active layout on your store at any given time. The active layout changes when your online visitors begin the checkout process.
theme.liquid file is the default active layout when visitors are browsing your online store and/or website. It usually renders the header content, footer content, navigation, and other global variables.
This becomes the active layout during the checkout process. Stores on the Shopify Plus plan can create and edit a
checkout.liquid file if desired. If your store isn't on Shopify Plus, then you can customize your checkout pages in the theme editor.