Because if we simply expand (x+y)2 we'd get x2+y2+2xy which shows that there's an extra term which is 2xy. another practical way to check your work and see why LHS ≠ RHS is by substituting random numbers, i.e. if x=2 and y=3 then LHS =25 whilst RHS =13, hence by adding 2xy=2(2)(3)=12 to the 13 it would give us 25.