Syntax of Using Math Mode: Empty Lines (Beginner Question)

I'm just starting to learn LaTeX. I tried typing

\begin{equation*}

(sample of different operators and symbols separated with \,)

\end{equation*}


and I got a whole bunch of errors. It seems LaTeX interpreted the empty line as the equation: when it saw nothing there, I guess it just ended math mode? It then said my other commands needed \$'s so I assume that's what happened. When I typed

\begin{equation*}
(sample of different operators and symbols separated with \,)
\end{equation*}


everything was fine. So I'm confused. If LaTeX sees an empty line in an environment, does it just interpret this as me changing my mind, and deciding not to use the declared environment?

An empty line in TeX should never be used just to arrange the source. It is an instruction exactly the same as the command \par which ends a paragraph and starts TeX's line breaking algorithm to split a paragraph into lines.

So it is not allowed in display math and it should never be used on the line before display math either, in that position it does not generate an error but forces TeX to take recovery action that produces a spurious white paragraph on the line above the display.