Introduction to SharePoint Site Definitions:
Site definitions are the foundation on which all sites are built in a SharePoint Server. Each site definition defines a unique type of SharePoint site. It is a collection of a files (.XML and .ASPX) that are located in the "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates" directory. The site definition determines the basic look of the SharePoint site and also contains much of the site's functionality. Site definitions can include items such as web pages, content types, lists, libraries, navigation bars, site columns, web parts, workflows, features to be activated, etc. The site definition is largely determined by the Onet.xml file.

Once a SharePoint site is created using a site definition, it will automatically have all the web pages, web parts, lists, libraries, content types, page layouts, master pages, etc. which are defined in that particular site definition. In other words we can say that a site definition includes all the functionalities of a custom site in one place that we can repeatedly use to create instances of a particular type of site with consistent results.

All the site definitions available at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates" directory are registered with the SharePoint server using "WEBTEMP.XML" file which is located at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML" directory. If a site definition's entry is not there in this "WEBTEMP.XML" file then this site definition will not appear in the list of site templates while creating new sharepoint site.

Limitation of Site Definitions:
SharePoint Site Definitions also has a limitation: any changes made in a site definition file will not affect existing sites, but it will reflect in the new sites created with this modified site definition.

Approaches to create Custom Site Definitions:
There are two approaches to create Custom Site Definition:

  1. Create New Site Definition manually: Either Start from scratch and create files one by one or Copy an existing Site Definition and modify it. For example, to create a custom site definition that derives from the team site definition for Windows SharePoint Services, copy the "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\STS" folder and modify the ONET.XML and .ASPX pages as per requirement.
  2. Create new Site Definition project in Visual Studio and create the new site definition using IDE as per your requirement. But first we need to install SharePoint Site Definition project template for Visual Studio.

Once new site definition is created, register it to SharePoint server by adding its details in the "WEBTEMP.XML" file.

To explore more about ONET.XML and WEBTEMP.XML, Please visit following msdn articles:
ONET.XML: http://msdn.microsoft.com/en-us/library/ms474369.aspx
WEBTEMP.XML: http://msdn.microsoft.com/en-us/library/ms447717.aspx