The essential point is that the polynomial ring in infinitely many variables is the ascending union of subrings $K[x_1,\ldots,x_n]$, since any polynomial can involve only finitely-many indeterminates. Each of these rings is a UFD, and it is easy to see that a polynomial in which $x_N$ does not appear has only factorizations in which $x_N$ does not appear, again because everything takes place inside some polynomial ring in finitely-many variables. But the ring is not Noetherian, because the ideal generated by all the indeterminates is certainly not finitely-generated.
Edit: in response to @rschwieb's comment/query about why $x_N$ cannot appear in any factorization of a polynomial $P(x_1,\ldots,x_n)$ not already involving it... If it did, then not only does $P$ have have its factorization in the UFD $K[x_1,\ldots,x_n]$, but also (allegedly) in the UFD $K[x_1,\ldots,x_n,\ldots,x_N]$, with $x_N$ in the latter, not in the former. Impossible.