What is the origin of the Phrase hanging in there?

This phrase comes from fruits ripe for the picking. This is because those fruits are in a precarious position ready to fall, be plucked or harvested. Similarly hanging in there regards social circumstances of standing bye in uncertainty awaiting resolve.