Axiom 3. Comprehension Scheme The following is from Kenneth Kunen's Book - Set Theory, An Introduction to Independence Proofs.

The Comprehension Axiom is intended to formalize the construction of sets of the form $\{x:P(x)\}$ where $P(x)$ denotes some property of $x.$ Since the notion of property is made rigorous via formulas, it is tempting to set forth as axioms statements of the form
$$ \exists y \forall x (x\in y \iff \phi)$$
where $\phi$ is a formula. Unfortunately, such a scheme is inconsistent by the famous Russell paradox : If $\phi$ is $x\in x,$ then this axiom gives us a $y$ such that  $$ \forall x(x\in y \iff x\notin x),$$
whence $y\in y \iff y\notin y.$ Fortunately in mathematical applications it is sufficient to be able to use a property $P(x)$ to define a subset of a given set, so we Postulate Comprehension as follows.
Axiom 3. Comprehension Scheme. For each formula $\phi$ without $y$ free, the universal closure of the following is an axiom  $$\exists y \forall x(x\in y \iff x\in z \,\wedge \phi).$$

My Question : Why is it that Axiom $3$ can prevent Russel Paradox in comparison with the first proposed definition? Can we not argue that if $\phi$ is $x\notin x $ in Axiom $3$ and come up with Russel Paradox again? Why is the introduction of $z$ in Axiom $3$ helpful?
 A: If we repeat the construction of Russell's Paradox with Axiom 3 above, what we get is:

$\forall x (x \in y \Leftrightarrow x \in z \land x \notin x)$

and instantiating it with $y$: $(y \in y \Leftrightarrow y \in z \land y \notin y)$, for some $y$, which is not a contradiction.
Can you see why? The formula built-up from the axiom asserts that for a set $z$ whatever we can find a suitable $y$ that satisfies it. In general, it is enough that $z \notin z$: in this case, we can select $z$ itself as value for $y$ and the left and the right-hand sides are both false, thus satisfying the formula.

The Comprehension Axiom is "too liberal" because it asserts the existence of every set for which we can specify a condition (the formula $\phi$).
In Axiom 3 [the so-called Specification axiom (schema)] we have a crucial modification: the specifying formula $\phi$ must be applied to a preexisting set $z$: it allows us to carve-out from set $z$ the subset $y$ of all and only those elements that satisfy $\phi$.
Thus, we cannot use it to "create" sets ex nihilo, but we can only apply it to already existing set.
An example will be $\emptyset$, whose existence is asserted by the corresponding axiom: we have no issues in using it as $z$ in Axiom 3, exactly because $\emptyset \notin \emptyset$.
