It replaces an element with another.
Press " (quotes key) to open the prompt. It will ask for the element type you want to change, and then the element you want to change it to.
Then, use the replace tool and it will change all pixels of the first element you click/hold it on to the second element.
By default, it changes Rock to Sand.