LaTeX is a "document processing system". It works on top of TeX, a system released in 1982 by Donald E. Knuth, in the hope that he could reverse the trend towards poor-quality typesetting. LaTeX (released in 1984) tries to let the user think about the structure of the document; TeX makes sure that the material is displayed beautifully.
There are a lot of books about TeX and LaTeX. Two online ones that I have found useful are: