Why your pages need a <doctype>
Not that long ago all you needed was.html as a file extension on your pages for a browser to know what to do with them. Now it is perfectly possible to write high quality html and css and for any browser to make a mess of it.
If your pages do not contain a <doctype> declaration and then stick with the tags that it allows then a browser goes into "quirks" mode. This means it attempts to emulate older browsers and renders the code as if it was an earlier version of itself. This allows it to render older documents of which there are plenty on the web. It also means that unless you include a doctype declaration you are wasting your time if you write quality code.
Doctype declarations come into html from xml. Doctype is short for "DOCument TYPE declaration." In xml you are free to "invent" your own tags. At the same time you need to supply a series of definition as to what each tag means and how to use it. These definitions are know as a Document Type Definition.
The files referenced in a doctype definition in html are in effect the DTD for that particular version of html. This is because html is a subset of xml. This is less obvious if you are writing code to meet html 2.0 but it is more apparent if you are writing xhtml 1.1.
The different doctypes form a set of rules for the browser when it is rendering the html and css. If the browser strictly follows doctype rules it may ignore tags entirely. If you declare a document as xhtml 1.1 a browser should ignore any tag written in uppercase or any attribute that was not enclosed in double quotes.
<P CLASS=foo>This would be ignored<P>
<p class="bar">This would be rendered<p>
