Standard Generalized Markup Language (SGML) is a way of expressing data in text-processing applications. It's been around for more than a decade; both XML and HTML are document formats derived from SGML. Thus they all share certain characteristics, such as a similar syntax and the use of bracketed tags. But HTML is an application of SGML, whereas XML is a subset of SGML.
The distinction is important. Basically HTML can't be used to define new applications, but XML can. For example, both the Resource Description Format (RDF) and the Channel Description Format (CDF) are applications that were defined using XML. XML and HTML are really more like cousins than siblings. (The W3C has developed a great diagram to help clarify this relationship.)
XML is actually compatible with SGML--XML documents can be read by any SGML authoring or viewing tool. However, XML is less complex than SGML, and it's designed to work across a limited-bandwidth network such as the Internet. According to Tim Bray, coeditor of the XML specification, the idea behind XML was to take the benefits of SGML, remove the complicated parts, keep it light, and make it work on the Web.
HTML, SGML, and XML will continue to be used where appropriate; none of them will render the others obsolete. HTML will remain the simplest way to publish data quickly on the Web, mostly short-term data such as meeting agendas or advertising brochures. If the data has a longer-term use and needs a bit more structure, Web builders will want to move to XML. Unlike HTML and XML, SGML will probably never gain widespread acceptance on the Internet, simply because it was never designed or optimized for the demands of a network protocol. For high-end, highly structured publishing applications, SGML will continue to fit the bill.