Every point on this line has one thing in common: the y coordinate is 2. So that is where comes from.
The x coordinate can be anything you want, which is why it's not present in the equation at all (so x cannot affect the outcome of y). Some example points on this line are (1,2), (5,2), and of course the given point (-2,2) as designed.