On your top picture see that thin band around the socket? Take a small screwdriver and pry up that thin band. Once it's up you can pull the bar or socket off the ball. This is by design and you're not going to break anything doing so. Once the piece is removed from the ball you can snap the band back down onto the socket.
Thread the piece back into the socket and figure out the length adjustment. Once it's where you want it put the socket over the ball and push down to snap it on.
If you don't get the adjustment correct just lift the band and pop the socket off the ball again. The real key to this whole puzzle is to make sure the band is on the socket before you try to push it back onto the ball.