Conditional probability is often introduced in the following way:
Consider a normal, fair 6-sided die. If you toss it then the probability $p(x=2)=1/6$. Now given that we already observed that the result is even, the probability $p(x=2|y=even)=1/3$, where it is obtained by $$\frac{p(x)}{p(y)}$$
Now later in the formal definition of conditional probability, it states that $$ p(x|y)=\frac{p(x,y)}{p(y)}$$
My question is: Under what assumptions can you swap $p(x,y)$ with $p(x)$ in the numerator?
Here notice that $X\cap Y=X$ because $X\subset Y$ since $2$ is even. So generally when events $A$ and $B$ and $A\subseteq B$ then we have $P(A\cap B)=P(A)$.
Also since $P(A\cap B)=P(A|B)P(B)$ so if $P(A|B)=1$ you have $P(A\cap B)=P(B)$ but also $P(A|B)=1$ will generally be true when $A\subseteq B$