As long as the center of gravity of the length of beads outside the jar is below the surface of the remaining string inside the jar, the gravitational force down on the length outside the jar will be greater than the gravitational potential to overcome lifting the string from inside the jar.
why does it lift?