A couple of questions about the first part of this answer.
$\kappa$ is a regular if and only if whenever $\lambda<\kappa$, and $\{A_i\mid i<\lambda\}$ is such that $|A_i|<\kappa$, then $|\bigcup\{A_i\mid i<\lambda\}|<\kappa$.
I want to better understand why this condition is equivalent to $cf(\kappa)=\kappa$. I'm using the definition of $cf(\kappa)$ from Enderton's textbook (I changed the letters to match the notation above):
The cofinality of a limit ordinal $\kappa$, denoted $cf(\kappa)$, is the smallest cardinal $\widetilde \kappa$ such that $\kappa$ is the supremum of $\widetilde \kappa$ smaller ordinals.
This means that $\kappa = \sup S$ where $S\subseteq \kappa$, $|S|=\widetilde \kappa$, and this $\widetilde \kappa$ is minimal such that the above holds.
The condition $cf(\kappa)=\kappa$ then means (I'm also replacing $\sup$ by $\bigcup$): $\kappa = \bigcup S$ where $S\subseteq \kappa$, $|S| = \kappa$, and if $\lambda < \kappa$, then for all $S\subseteq \kappa$ with $|S| =\lambda$, $\bigcup S \ne \kappa$ (I guess the last part can be replaced by $|\bigcup S| < \kappa$).
This looks very similar to the first quote in this question, but I don't see why the two are exactly the same. Does my $S$ correspond to $A_i$ from the first quote? What does $\{A_i : i < \lambda\}$ correspond to then? Why is there no condition corresponding to my $\kappa = \bigcup S$ ?
Also, I have a question about the same answer that is slightly unrelated to this characterization of regular cardinals, but I'm not sure if it's worth creating a separate question for it, so I'll ask it here (I also asked it in the comments): In the case $\kappa=\omega$, we know that each $\bigcup^i$ is finite, and we need to prove that $\cup_{i < \omega} \bigcup^i x$ is finite. But isn't it false in general that the countable union of finite sets is finite? How does the fact that "these iterated $\bigcup$ must stabilise after a finite number of steps" (and what exactly does this mean?) help?
For your first question, any $\lambda<\kappa$ can be thought of as a "failed cofinality" of $\kappa$. If we set $\lambda=\kappa$, and we have a set $\{A_i\mid i<\kappa\}$ where each $\vert A_i\vert <\kappa$ and $\vert\bigcup\{A_i\mid i<\lambda\}\vert=\kappa$, then any attempt to decrease $\lambda$ (i.e. restrict the sequence $A$) will cause the condition $\vert\bigcup\{A_i\mid i<\lambda\}\vert=\kappa$ to fail. This made it difficult to find the condition corresponding to "$\kappa=\bigcup S$", because in the former characterization instead of having a union condition holding when $\lambda=\kappa$ as "$\kappa=\bigcup S$" looks like, we had a union property that fails fails for any $\lambda$ less than $\kappa$.