Most often when DocBook comes up it is mentioned together with SGML and XML and indeed there is a close relation between them. A good many times when people get in touch with DocBook for the first time they try to correlate all this with HTML that is widely spread and hence is well known. The following lines try to clear things up a bit.
HTML - Hyper Text Markup Language
HTML is a markup language invented around 1990 by Tim Berners-Lee originator of the www. Despite the fact that SGML already existed in those days he created a simple selfcontained language that was capable of hyperlinking to power his idea of a linked information system. The language was well adopted by various authors who wrote browsers for it. The invention of the well known Mosaic browser by NCSA finally started the ever growing www.
HTML does not have formatting capabilities. It only defines the structure of the document. Therefore a headline is defined as a Headline (an object) but the document does not contain any information regarding how a headline should be displayed. Layout affairs are therefore left to the browser which has some internal rules to display HTML objects.
Note: Nowadays more and more proprietary HTML extensions suitable to do funny things with web pages weaken this concept which is very bad. This is one of the reasons that led to the invention of XML which has much more functionality in this respect.
SGML - Standard Generalized Markup Language
SGML is not a markup language for itself but a meta language suitable for defining markup languages. Such definitions are known as DTD (Document type definition). It is important to know that DTDs never contain any formatting information but only structural information. Layout information is held in separate files, e.g. in CSS files (cascading style sheets). In contrast to HTML SGML has much more structural functionality and hence a well designed markup language defined by means of SGML provides much more semantic rules, e.g. automatic chapter numbering. Of course there is no need to use this wealth of functionality and so one could re-implement HTML using SGML. In fact that has been the case with the XHTML-DTD.
Note: No one writes a final document in native SGML without using stylesheets! Those stylesheets are either predefined when using an already existing documentation system or the author must provide them by defining some sort of documentation system for himself.
XML - Extended Markup Language
XML is a subset of SGML that is a bit long winded due to the wealth of functionality and the high level of abstraction. XML is defined via SGML by creation of a DTD, the XML-DTD. It has been invented as a future replacement for HTML that has proven to be somewhat exhausted with respect to the ever growing demands of modern web publishing. Current browsers already understand XML (at least a subset thereof) so that XML documents need not be transformed into another format in the future. A document in XML format in fact contains SGML but is restricted to the definitions from the XML-DTD and using the style elements defined therein.
DocBook
DocBook is a system suitable for producing technical documentation. It is realized by means of DTDs for SGML and XML. In the sense of abstraction DocBook defines a markup language that is either based on native SGML or XML. A document produced in DocBook-SGML contains SGML text that conforms to the restrictions imposed by the DocBook-DTD and consisting of the elements defined therein. In contrast a document written in DocBook-XML contains XML text (which also is SGML in a certain sense) that also conforms to the restrictions imposed by the DocBook-DTD and consisting of the elements defined therein. Future browsers may be able to display DocBook-XML documents directly due to the fact that they contain XML text.