There's a gap between how we normally do mathematics as an "informal-but-rigorous" activity and how we formalize mathematics inside $\mathsf{ZF}$ or similar. To get there from here we have to choose some method of implementation of our standard mathematical ideas into the set-theoretic framework. Specifically, $\mathsf{ZF}$ adopts the position that everything is a set, and that means we have to find ways to "encode" the not-really-set-flavored mathematics we do day-to-day in terms of just $\in$.
For the natural numbers this is done via the finite (von Neumann) ordinals - specifically, a "natural number" in the sense of $\mathsf{ZF}$ is an ordinal which is not in bijection with any of its proper subsets. The first few natural numbers in this sense are $$0=\emptyset, 1=\{0\}=\{\emptyset\}, 2=\{0,1\}=\{\emptyset,\{\emptyset\}\}, ..., n+1=\{0,1,...,n\}=n\cup\{n\},...$$
From this we can directly calculate $\bigcup\mathbb{N}$:
It's exactly $\mathbb{N}$ itself! Neat, huh?
There are a few tricks to "set-ifying" mathematics. The above is one of these: the idea to represent natural numbers by finite ordinals "gets us off the ground." Another fundamental point is the observation that we can talk about ordered pairs - and hence relations, functions, etc. - using set theory alone: see here. Note that these aren't axioms (or theorems), but rather methodological choices we make about how to translate mathematics into the narrow language of set theory; the $\mathsf{ZF}$ axioms come into the picture when we prove the desired facts about these implementations. E.g. it's not at all obvious at first how to define addition of natural numbers in terms of set theory alone, but there's a $\mathsf{ZF}$-theorem which does the job (the recursion theorem).
Now one might reasonably object to this "all-things-are-sets" framework for mathematics; see e.g. the discussion here, and more tangentially here. Opinions on the matter vary.
So what does make a class fail to be a set?
Well, in $\mathsf{ZF}$ it's ultimately all down to size. For a class $C$, exactly one of the following holds:
(Actually the above is a bit slippery since $\mathsf{ZF}$ can't talk about classes directly, but I'm ignoring this point.)