Quoted from mg81:Magic Erasers are just melamine foam, I am not aware of them having any soap product in them.
Do a search for melamine foam to get a better idea of the products history. My memory is that they work just like a pencil eraser, by mechanically removing material while the foam is also consumed/covered by the material that is being removed.
They are basically a 2000 grit sand paper equivalent. I was always told the white was lacquer that you had removed and that is why it hardens when it dries. I do not end up with the white residue when I use it on my counter tops or walls after my kids draw with a crayon.