In order to understand the notion of modes, we first need to understand that the way TeX works is that it just typesets boxes. What is in these boxes is immaterial for TeX. If your manuscript contains only text, these boxes are built primarily while TeX is one of two modes. In the horizontal mode, it stacks boxes next to each other and in vertical mode boxes are stacked on top of each other. These are called horizontal or vertical lists.
So generally when TeX is in horizontal mode it is busy building lines of TeX and when it is in vertical mode it is stacking boxes of lines or paragraphs one on top of each other.
In one of the math modes it is reading a formula. Think of modes as program switches. Depending on what TeX is typesetting, the switch enables different modes to perform different tasks such as allowing or disallowing primitive commands and the like.
When TeX is in vertical mode or internal vertical mode, the first token of
a new paragraph changes the mode to horizontal for the duration of a paragraph.
You can also tell TeX explicitly to go into horizontal mode, instead of relying
on such implicit mode-switching, by saying \indent or \noindent. Plain, LaTeX and pdfTeX have built-in macros to make easier to switch from one mode to another such as \leavevmode, which is simply a void box that is opened:
\protected\def\leavevmode{\unhbox \voidb@x}
The minutiae can be found in the TeXbook or TeX by Topic. Also the e-tex manual has a lot of macros that enable detection of modes. There is also a very good article in TUGboat about how the TeX processor works.
texdoc texbytopic). – Caramdir Mar 10 '11 at 19:25:-). – Willie Wong Mar 11 '11 at 15:19