What is the concept of ghosting and unghosting in SharePoint?

Ghosted pages:pages which are loaded from the file system are termed as ghosted pages.
 
UnGhosted pages: f the page data is loaded from the content database, it’s termed an unghosted page
 
In SharePoint, most site pages derive from templates. The custom pages only store the differences between them. The template is loaded in memory and applied to the custom pages on the fly.
In other words, the template is stored in a cache. This definitely brings in performance and flexibility. Flexibility is in terms that when we change the template page, it’s applied to all custom pages. These pages are loaded from the file system. So pages which are loaded from the file system are termed as ghosted pages.
 
Thanks for learning my blogs!!!!