Let's minimize the example
\documentclass{article}
\pagestyle{empty}
\showoutput
\begin{document}
Test
\vspace{30pt}% so we can see it better in the output
\parbox[c][0pt]{\linewidth}{}
\vspace{30pt}
Test
\end{document}
In the console output we see
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
.\glue 16.0
.\vbox(617.0+0.0)x345.0, shifted 62.0
..\vbox(12.0+0.0)x345.0, glue set 12.0fil
...\glue 0.0 plus 1.0fil
...\hbox(0.0+0.0)x345.0
..\glue 25.0
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 455.9513fil
...\write-{}
...\glue(\topskip) 3.16669
...\hbox(6.83331+0.0)x345.0, glue set 311.33333fil
....\hbox(0.0+0.0)x15.0
....\OT1/cmr/m/n/10 T
....\kern-0.83334
....\OT1/cmr/m/n/10 e
....\OT1/cmr/m/n/10 s
....\OT1/cmr/m/n/10 t
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue 30.0
...\glue 0.0
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 9.5
...\hbox(2.5+0.0)x345.0, glue set 330.0fil
....\hbox(0.0+0.0)x15.0
....\mathon
....\vbox(2.5+-2.5)x0.0
.....\glue 0.0 plus 1.0fil minus 1.0fil
.....\glue 0.0 plus 1.0fil minus 1.0fil
....\mathoff
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue 30.0
...\glue 0.0
...\glue(\parskip) 0.0 plus 1.0
...\glue(\baselineskip) 5.16669
...\hbox(6.83331+0.0)x345.0, glue set 311.33333fil
....\hbox(0.0+0.0)x15.0
....\OT1/cmr/m/n/10 T
....\kern-0.83334
....\OT1/cmr/m/n/10 e
....\OT1/cmr/m/n/10 s
....\OT1/cmr/m/n/10 t
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0
...\glue 0.0 plus 1.0fil
...\glue 0.0
...\glue 0.0 plus 0.0001fil
..\glue(\baselineskip) 30.0
..\hbox(0.0+0.0)x345.0
The \parbox
corresponds to
....\hbox(0.0+0.0)x15.0 % <- indent
....\mathon % <- start math mode
....\vbox(2.5+-2.5)x0.0 % <- a \vbox from \vcenter
.....\glue 0.0 plus 1.0fil minus 1.0fil % <- the glue for vertical centering
.....\glue 0.0 plus 1.0fil minus 1.0fil % <- the glue for vertical centering
....\mathoff
because the [c]
option uses internally math mode to do \vcenter
and the actual height and depth are 2.5pt (because of the standard height of the formula axis). However, the explanation lies just before this part, namely
....\glue(\parfillskip) 0.0 plus 1.0fil % <- the paragraph for Test has ended
....\glue(\rightskip) 0.0 % <- no \rightskip
...\glue 30.0 % <- the \vspace{30pt}
...\glue 0.0 % <- from \vspace implementation
...\glue(\parskip) 0.0 plus 1.0 % <- a paragraph has started
...\glue(\baselineskip) 9.5 % <- vertical glue
...\hbox(2.5+0.0)x345.0, glue set 330.0fil % <- a line
The final \hbox
is what encloses the \parbox
and is preceded by glue from \baselineskip
in the amount of 9.5pt: indeed, the height of the box is 2.5pt and 9.5 + 2.5 = 12 (the value of \baselineskip
).
Similarly, you see after the box
....\penalty 10000 % <- from \par
....\glue(\parfillskip) 0.0 plus 1.0fil % <- a paragraph has ended
....\glue(\rightskip) 0.0 % <- no \rightskip
...\glue 30.0 % <- \vspace{30pt}
...\glue 0.0 % <- from \vspace
...\glue(\parskip) 0.0 plus 1.0 % <- a paragraph has started
...\glue(\baselineskip) 5.16669 % <- glue
...\hbox(6.83331+0.0)x345.0, glue set 311.33333fil % <- the paragraph for Test
The \penalty 10000
is due to the blank line after \parbox
, which ends the paragraph.
If you do \parbox[c][0pt]{\linewidth}{X}
, then you'd see more: an Overfull \hbox
message, due to the indentation being followed by a box that make more the line width. However the vertical spacing between the two instances of “Test” would not change, because the parbox fits vertically in the \baselineskip
.
In other words, you have three paragraphs, with added vertical space between them.
Actually, the \vspace
commands are a kind of red herring. If you consider
\documentclass{article}
\pagestyle{empty}
\begin{document}
Test 1
Test 2
\parbox[c][0pt]{\linewidth}{}
Test 3
\end{document}
you get

It would be different if you used \nointerlineskip\vbox to 0pt{}
: here's a side by side comparison:
\documentclass{article}
\begin{document}
\settowidth{\dimen0}{Test 1}
\parbox{\dimen0}{Test 1
Test 2
Test 3}%
\parbox{\dimen0}{Test 1
Test 2
\nointerlineskip\vbox to 0pt{}
Test 3}
\end{document}

\par
ends the line and the paragraph, I would expect a\baselineskip
+\parskip
(default in the standard classes=0pt plus1pt
) for the next paragraph to start. Unrelated2: width can also be 0: try\fbox{\parbox[c][0pt]{0pt}{x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x }}
.