Y is from a vector. Position is a Vector2(X,Y) for 2D and by calling position.y you are changing it’s Y value.
In short vectors are points on Grids.

This is what a 2D vector looks like:

As you can see if the position is (0,0) and we add 1 to Y. We get an arrow pointing UP.
A vector can represent any rotation:

The awesome thing about vectors is that it keeps both the rotation and direction inside it.
So we can get how far a enemy is and at what angle, by just knowing our own grid position and the enemy position.