Let $X,Y$ be schemes over a field $k$. I know that $X \times_k Y$ is not equal to the catesian product $X \times Y$. For example $\mathbb{A}_{k}^2 \neq \mathbb{A}_{k} \times \mathbb{A}_{k}$.
So, I don't understand example II.4.0.1 in Hartshorne's book.
This example explain that if $X$ is the affine line with double origin points, then $X\times_k X$ is the affine plane with double axes and four origin points... in this case, why $X\times_k X= X\times X$? and my additional question is that in general case, is there condition that $X \times_S Y = X\times Y$?, where $S$ is an arbitrary scheme?