If you compare
Plot[a x, {x, -5, 5}] /. a -> 3
and
Plot[a x /. a -> 3, {x, -5, 5}]
I think you might be able to guess that the first one is first trying to do the Plot, not knowing the value of 'a' and failing, and perhaps then considering the substitution
while the second one is first doing the substitution and then doing the Plot.
You might test this idea under other circumstances, perhaps even using ReplaceAll[a x,a->3] instead of the /. and try to see if you can recognize a general pattern in the way that evaluation of expressions is done within Mathematica.
This may be somewhat complicated because Plot and some other functions do not perform evaluation in exactly the same way that generic expressions do.