How we got $z\cdot(x+y)=x\cdot y$ This is from "Test of math at 10+2 level":

A vessel contains $x$ gallons of wine and another contains $y$ gallons of water. From each vessel $z$ gallons are taken out and transferred to the other. From the resulting mixture in each vessel, $z$ gallons are again taken out and transferred to the other. If after a second transfer, the quantity of wine in each vessel remains the same as it was after the first transfer, then show that $z\cdot(x+y)=x\cdot y.$

*My Try:*$$\text{Originally:}\begin{array}{|c|c|c|} 
\text{Vessel:} & \text{1} & \text{2} \\ \hline
\text{Wine} & x & 0 \\ \hline
\text{Water} & 0 & y \\ \hline
\end{array}$$
$$\text{After first transfer:}\begin{array}{|c|c|c|} 
\text{Vessel:} & \text{1} & \text{2} \\ \hline
\text{Wine} & x-z & z \\ \hline
\text{Water} & z & y-z \\ \hline
\end{array}$$
$$\text{After second transfer:}\begin{array}{|c|c|c|} 
\text{Vessel:} & \text{1} & \text{2} \\ \hline
\text{Wine} & x-z-\left(\frac{x-z}{x}\right)\cdot z & z+\left(\frac{x-z}{x}\right)\cdot z \\ \hline
\text{Water} & z-\left(\frac{z}{x}\right)\cdot z & y-z+\left(\frac{z}{x}\right)\cdot z \\ \hline
\end{array}$$
And because, the quantity of wine in each vessel remains the same as it was after the first transfer, $$x-z=x-z-\left(\frac{x-z}{x}\right)\cdot z\tag1,$$$$z=z+\left(\frac{x-z}{x}\right)\cdot z\tag2,$$ which implies $x=z$. Where am I wrong?

The problem is symmetric in $x$ and $y$.  That means that at any step, you should be able to reverse:
1) $x$ and $y$
2) Wine and Water
3) vessel 1 and vessel 2
And the result is the exact same relation.
You can also check at each step that wine in vessel1 plus water in vessel1 is x, and that wine in vessel2 plus water in vessel2 is y.
Notice that after the second transfer, the triple reverse doesn't give you back the same equation.  The sums do not work out either.  That tells you where a mistake is.
$$
\text{After second transfer:}\begin{array}{|c|c|c|} 
\text{Vessel:} & \text{1} & \text{2} \\ \hline
\text{Wine} & 
x-z-\underbrace{\left(\frac{x-z}{x}\right)\cdot z}_{\text{loss of wine}} 
+ \underbrace{\frac z y z}_{\text{gain of wine}} &
 z+\underbrace{\left(\frac{x-z}{x}\right)\cdot z}_{\text{gain of wine}} - \underbrace{\frac z y z}_{\text{loss of wine}} \\ \hline
\text{Water} & 
z-\underbrace{\left(\frac{z}{x}\right)\cdot z}_{\text{Loss of water}} + \underbrace{\frac z y (y - z)}_{\text{Gain of water}} &
y-z+\underbrace{\left(\frac{z}{x}\right)\cdot z}_{\text{Gain of water}}  - \underbrace{\frac z y (y - z)}_{\text{Loss of water}} \\ \hline
\end{array}
$$
From the wine amount being the same in the first vessel:
$$x - y = x-z-\left(\frac{x-z}{x}\right)\cdot z + \frac z y z \tag{Wine is same in vessel 1}$$
$$x - y = x-z-z+\frac{z^2} x + \frac {z^2} y$$
$$2z = y +\frac{z^2} x + \frac {z^2} y$$
$$2 = \frac y z +\frac{z} x + \frac {z} y \tag{R1}$$
As it turns out, $R1$ isn't necessary to solve the problem.  Sometimes that happens, you get extra information.  Let's look at the second vessel.
Edit: there is a mistake in the initial equation, it should be $x - z = $ rather than $x - y =$ so a corrected form of R1 is useful.
$$ z = z+\left(\frac{x-z}{x}\right)\cdot z - \frac z y z \tag{Wine is same in vessel 2}$$
$$ z = z+z-\frac{z^2}{x} - \frac {z^2} y$$
$$ z = \frac{z^2}{x} + \frac {z^2} y$$
$$ 1 = \frac{z}{x} + \frac {z} y$$
$$x \cdot y = z \cdot(x + y)$$
