It's just like the brush, but only for the [secondary color][ps]

In layers that have no transparency, like the bottom layer of non-transparent projects, the eraser will paint the [secondary color][ps]. In transparent layers the eraser will simply delete the pixels it passes through.

Keep in mind that opacity is also valid for the eraser.