Let's simplify your example. The main point is here
\hsize=6cm % just to get a two line paragraph
\vbox{When there is just text inside a vbox
it uses the whole hsize and indents}
\vbox{\hbox{except when}\hbox{it consists}\hbox{of consecutive}\hbox{hboxes}}
A \vbox has depth equal to the depth of the last item inside it. Thus both vboxes have depth zero, because by chance the second line in the first box has no descender and the same holds for \hbox{hboxes}.
All the rest contributes to the height of the \vbox. Thus, when TeX wants to pile the two vboxes over each other, it computes the interline glue. But, clearly, the height of the second \vbox is larger than \baselineskip, so the rule imposes TeX to insert \lineskip glue (default value 1pt).
Let's see a picture obtained by setting \lineskip to 20pt, just to see that it's inserted:

How do we solve the problem? Here's the answer:
\hsize=6cm % just to get a two line paragraph
\vbox{When there is just text inside a vbox
it uses the whole hsize and indents\strut}
\nointerlineskip
\vbox{\hbox{\strut except when}\hbox{it consists}\hbox{of consecutive}\hbox{hboxes}}

Just inhibit the \baselineskip-\lineskiplimit-\lineskip computations with \nointerlineskip and ensure that the two lines are correctly separated by using struts. This won't work, though, if either the \vbox above has large depth or the first box in the \vbox below has large height.
Let's tackle now the \halign and \valign problem. The input
\setbox0=\vbox{% halign is vertical mode material
\halign{& \strut$#\hfil$\cr
a& b& c\cr
d& e& f\cr
g& h& i\cr}}% each cell expands out to \hbox{...
is equivalent to do
\setbox0=\vbox{
\hbox{\hskip0pt
\hbox to X{\strut$a\hfil$}\hskip0pt
\hbox to X{\strut$b\hfil$}\hskip0pt
\hbox to X{\strut$c\hfil$}\hskip0pt}
\hbox{\hskip0pt
\hbox to X{\strut$d\hfil$}\hskip0pt
\hbox to X{\strut$e\hfil$}\hskip0pt
\hbox to X{\strut$f\hfil$}\hskip0pt}
\hbox{\hskip0pt
\hbox to X{\strut$g\hfil$}\hskip0pt
\hbox to X{\strut$h\hfil$}\hskip0pt
\hbox to X{\strut$i\hfil$}\hskip0pt}
}
where X stands for the maximum width of the cells (computed by TeX) and \hskip0pt comes from the default value of \tabskip.
This has the same property as before: the depth of the box is the depth of the last box inside it (so it's the depth of the strut) and the rest contributes to the height. The reference point is the same as the last box reference point, so the math mode "g", "h" and "i" sit on the baseline determined by this reference point.
What about the \valign? The input
\setbox2=\hbox{% valign is horizontal mode material
\valign{& \hbox{\strut$#\hfil$}\cr
a& d& g\cr
b& e& h\cr
c& f& i\cr}}% each cell expands out to \vbox{\hbox{...
\hbox{\box0\box1}
is equivalent to
\setbox2=\hbox{%
\vbox{\vskip0pt
\vbox to X{\hbox{\strut$a\hfil$}}\vskip0pt
\vbox to X{\hbox{\strut$d\hfil$}}\vskip0pt
\vbox to X{\hbox{\strut$g\hfil$}}\vskip0pt}%
\vbox{\vskip0pt
\vbox to X{\hbox{\strut$b\hfil$}}\vskip0pt
\vbox to X{\hbox{\strut$e\hfil$}}\vskip0pt
\vbox to X{\hbox{\strut$h\hfil$}}\vskip0pt}%
\vbox{\vskip0pt
\vbox to X{\hbox{\strut$c\hfil$}}\vskip0pt
\vbox to X{\hbox{\strut$f\hfil$}}\vskip0pt
\vbox to X{\hbox{\strut$i\hfil$}}\vskip0pt}%
}
where X is the maximum height of the cells (in this case it's \ht\strutbox). But here the "bad thing" happens! The reference point is determined by the last item, which is glue. So the bottom of the $g$ sits on the line determined thereby.
Just do
\noindent\rlap{\vrule height0.4pt width 4cm}\vrule\box2
(where in place of X you write \ht\strutbox) and you'll realize the fact.
Here it is: the first is the \valign, the second the "equivalent" box.

\vbox{vbox,}:-)But now that I understood it, I see that it nicely demonstrates how the whole hsize and indents are used by this\vbox. – Hendrik Vogt Jun 19 '12 at 11:04\smallskip; however, setting\dp0is useless, as you\unvbox0. Also you're forgetting to set\dimen255=\prevdepthafter the\smallskipin\bquo. The original question had\halignand\valign: it's a very different setting. – egreg Jul 12 '12 at 16:40\vbox. – kiss my armpit Jul 12 '12 at 17:12