You have asked "why". I try to explain this.
The LaTeX macro tblr
opens horizontal mode without indentation (does \noindent
) and puts here a box with given contents with the width equal to \hsize
. It doesn't close the opened horizontal mode. Then the space after \end{tblr}
follows and then empty line, which runs \par
. This TeX primitive command removes the last space (i.e. the space from the end of the line after \end{tblr}
) and the remaining material fits to \hsize
width and single-line paragraph is created. The space in your macro (after \secondline{
) is processed in vertical mode and does nothing.
The second case (without empty line): you have two spaces after tblr
box in horizontal mode. First one is from the end of \end{tblr}
and second from our macro. Then tcolorbox
macro runs \par
before the box is created. So you have "space space \par
". The \par
primitive removes only single space, i.e. one space remains after tblr
box. The paragraph is created with two lines because tblr
box plus following space doesn't fit to \hsize
.
From TeX primitive point of view, your first case can be emulated by
\noindent\hbox to\hsize{Line 1\hss}\space\par \space\par\hbox{Line2}
and your second case can be emulated by
\noindent\hbox to\hsize{Line 1\hss}\space \space\par\hbox{Line2}
The new LaTeX is more complicated, because \par
isn't TeX primitive, but this doesn't mater for this issue.