XG (Extended Generalised Line/Sector Types) is a powerful, flexible addition to the mapper's arsenal that can help to bring life to static maps. Creative use of XG enables the mod author to engineer entirely new interactive elements, from complex machines and logic puzzles to scripted sequences and more.
Doom has a number of hard-coded line and sector types, each of which are programmed to do certain effects like lower a lift, open a door or, in the sectors' case, perhaps just to blink randomly. They were designed to be used in the game's own maps and thus do not provide the best possible selection of effects for your ones.
The XG system was developed to allow you to create your own line and sector types for use in PWADs.
If you are new to XG you would be well advised to start off with the basics and move on when comfortable. There is a lot to learn.
Line types separate the activation method, activation requirements and the effects of the line. It is possible to create 'chains' of line types, which effectively combine many types of line into one. Chains are a very important part of XG. Often it is easiest to define several line types, each performing a simpler (perhaps re-usable) function and then chain them up behind a single line special.
Sector types define various physical characteristics of a sector, like light level and color, wind and gravity. Sector types also specify a number of event triggers which occur in accordance to or as a result of interpreting these characteristics under a certain set of circumstances (meaning that everything possible through changes to the state of lines is also possible through sectors).
XG line and sector types are entirely separate from the original Doom types. Both the extended and the standard types can be used in a map.
These articles deal with the fundamental concepts of XG and how they pull together to form the building blocks of the system itself.