To imagine how one would work in a space ship, imagine a very long ship that acts like a particle accelerator. Take an atom from the front end, accelerate backward to near the speed of light so that it's mass increases say 1000 times. While that atom is flying backward, your ship that pushed on it moves in the opposite direction. Catch it again in the rear, and the ship must return to zero speed because of conservation of momentum, however the ship is now in a slightly different spot.
Move that atom back to the front of the ship, but slowly so it's mass stays low. Your ship moves backward, but not quite as far as it moved before. Do this again and again to translate the ship. The net velocity of the ship will always be zero though.