In the former, the value is already stored somewhere, and you are setting $x to refer to that location. In the latter, the $y already* refers to a location, and you are putting a value into it.
* in this case, the location is created and assigned Just In Time.
Caution: Contents may have been coded under pressure.