While searching on Google, the autocomplete results show up below, just like many other sites.
But apart from that, there’s a faded text autocomplete for the most probable search query that appears in the input box itself without changing the position of the cursor. See the attached screenshot. I checked the console, but nothing useful there.

How is an effect like that achieved?
Google does it by setting the value of a separate
inputelement which is stacked directly behind the “active” one. If you look at the source, you can see there are a number of elements in the same place:It’s the second
<input>that seems to be handling the greyed-out suggestion text.