Erase pixels with the background color when used on the background layer, and with the transparent color on transparent layers.
If you use the Eraser tool with the right-click, it will replace the foreground color with the background color.
SEE ALSO