Consider $X,Y$ 2 sets. One wants to define $X\cap Y$. There is no guarantee that $X\cap Y$ will be a set on the formal level.
Consider class $C=\{x\mid x\in Y\}$ where $x\in Y$ is treated as property $P(x)$. From separation axiom, one deduces $C\cap X$ saying $x\in C\cap X$ iff $x\in X$ and $x\in Y$. Hence from extensionality, one deduces $C\cap X=X\cap Y$.
However, it seems that $x\in C$ iff $x\in Y$ as well. Thus I deduce $C=Y$ to start with. This indicates $C$ is a set to start with.
$\textbf{Q:}$ Did I miss something critical here as the book seems implying class is necessary? The book says one consequence of separation axiom is that intersection and difference between 2 sets are sets which allows defining such operations. When I was trying to see this, I defined the class first and then intersect with $X$ as prescribed by property $P(x)=x\in Y$. The difference is done similarly by replacing $P(x)=x\not\in Y$. In either case, I do not see necessity of usage of class.
Ref. Set Theory, Jech Pt I, Chpt 1, Separation Axioms.
We have to apply Separation (see Jech, page 8) :
Being a class, $C$ is $\{ x : \varphi(x) \}$ for some formula $\varphi(x)$; thus, we need the following instance of Separation :
Obviously, it holds also with $C=Y$ a set, because every set is also a class : $C = \{ x : x \in Y \}$.