How do erasable pens work?
Instead of a typical oil/dye ink,  erasable pens use a compound closer to rubber cement, which acts like a liquid when a bit of pressure is exerted. 1
A bit of history and a link to patents can be found here
EDIT: Be sure to check out the other answer here about thermochromic ink too.