The <doctype> tag isn't absolutely essential. It's all about standards in HTML.
The purpose is to let a browser know which version of HTML is being used and, subsequently, which tags to expect. Should a browser come across an unknown tag then it will be ignored.
http://www.w3.org/TR/html401/struct/global.html gives more information on doctype and how it can be used.