Tiny computers mounted on snail shells helped reveal how one species escaped extinction