Jhak maarna, or Jhakh maarna to be more precise, means to do nothing, sit idle. And when someone says Jhak maar ke, it means eventually, finally, in a situation when you don't want to do some particular thing but you ultimately have to do it.
The two meanings here relate something like this: When you trying not to do something and due to that you don't have an option left, and you're unable to proceed with anything, you eventually do the thing.
I have tried my best here explain the relation between the two phrases, though I don't know how successful I have been here.