The eraser is used to erase parts of an image. It uses the background color.
The current brush defines the shape of the eraser.
Clicking on Work on whole picture clears the whole image (currently selected). Double clicking the tool icon has the same effect.
A quick way to set the background color is holding Shift+Alt and clicking into the image.