The LaTeX command typesets a file of text using the TeX program and the LaTeX Macro package for TeX. To be more specific, it processes an input file containing the text of a document with interspersed commands that describe how the text should be formatted. It produces at least three files as output:
xdvi
,
which actually uses the `.dvi' file.
For a description of what goes on inside TeX, you should consult The TeXbook by Donald E. Knuth, ISBN 0-201-13448-9, published jointly by the American Mathematical Society and Addison-Wesley Publishing Company.
For a description of LaTeX, you should consult:
LaTeX: A Document Preparation System, by Leslie Lamport, Addison-Wesley Publishing Company, 2nd edition, 1994.
The LaTeX Companion, by Michel Goossens, Frank Mittelbach, and Alexander Samarin, Addison-Wesley, 1994.