The Magic Eraser tool changes all similar pixels when you drag within a photo. If you’re working in a layer with locked transparency, the pixels change to the background color; otherwise, the pixels are erased to transparency. You can choose to erase contiguous pixels only, or all similar pixels on the current layer.