Since you are going into GR I believe some elaboration might be good. In General Relativity spacetime is a smooth four dimensional Lorentzian manifold $(M,g)$.
Being a manifold means that $M$ is one Hausdorff topological space (don't mind too much about this by now) and that there is a collection of pairs $\mathcal{A}=\{(x_\lambda,U_\lambda)\}$ where $U_\lambda\subset M$ is open, $M$ is the union of all the $U_\lambda$ and $x_\lambda : U_\lambda \to \mathbb{R}^4$ is a coordinate system: i.e., it assigns to each point $p\in U_\lambda\subset M$ the coordinates
$$x_\lambda(p)=(x_\lambda^0(p),x_\lambda^1(p),x_\lambda^2(p),x_\lambda^3(p)).$$
There is the additional condition that given two coordinate systems $(x,U)$ and $(y,V)$ on $M$ if their domains overlap $U\cap V \neq \emptyset$ then $T_{y,x}=x\circ y^{-1}$ and $T_{x,y}=y\circ x^{-1}$ are both $C^\infty$ functions on $\mathbb{R}^4$. These are respectively the map that transforms $y$ coordinates in $x$ coordinates and vice versa.
In summary: being a topological space gives the notion of continuity and open sets, and the existence of these functions with the overlap condition, ensures you have local coordinates which are smoothly put together to make up the whole spacetime.
So in GR we have a clear separation between the points and their coordinates. The points lie in $M$, the coordinates lie in $\mathbb{R}^4$ and what brings them together are the coordinate systems as defined above.
Now, a real scalar field is a $C^\infty$ function $\phi : M\to \mathbb{R}$. Nothing more to say about it.
How can it be? Where the transformation law is gone? Well, I haven't introduced coordinates above. I've defined the object intrinsicaly to spacetime $M$.
Now let $p\in M$ and a coordinate system $(x,U)$ around $p$ be given, namely $p\in U$. Then, we can localy, on $U$, resolve $\phi$ in coordinates. Since $x : U\to \mathbb{R}^4$ we have that $x^{-1} : \mathbb{R}^4\to U$ takes coordinates to the corresponding point.
The composite function $\phi_{(x)}=\phi \circ x^{-1} : \mathbb{R}^4\to \mathbb{R}$ is the coordinate expression of $\phi$. Notice that it takes some coordinate values and gives $\phi$ on the point corresponding to them.
Now the issue with coordinate systems is that they are not unique nor there is any prefered one. Imagine I pick another coordinate system $(y,V)$ with $p\in U\cap V$. Then we can also get the coordinate expression $\phi_{(y)}=\phi\circ y^{-1}$.
Now focus on the overlap. You shall notice that the following happens:
$$\phi_{(y)}=\phi\circ y^{-1}=(\phi\circ x^{-1})\circ x \circ y^{-1}=\phi_{(x)}\circ (x\circ y^{-1})=\phi_{(y)}\circ T_{y,x}$$
Obviously $T_{x,y} = (T_{y,x})^{-1}$ Thus you finaly conclude that
$$\phi_{(y)}\circ T_{x,y} = \phi_{(x)}$$
This is precisely what you wrote, take a time to understand that.
When $\phi : M\to \mathbb{R}$ is already defined as a function on $M$ then this condition is satisfied as a result.
But generaly you want to define it from coordinates, because it is easier and more intuitive. Then this becomes a compatibility condition to ensure that the object you are defining is actually a well defined function on $M$, i.e., it doesn't depend on the coordinates themselves.