A ship is pitching at sea. Her sailors are working frantically to lower her sails as they're lashed with winds and violent waves; the masts are creaking in the gale, water is spilling into her belly. Planks are buckling from the violence of the wind and rain, her cargo is pulling against gravity in the hold. Passengers have strapped themselves to anything solid in hopes they will not wash overboard.
A ship making an open water crossing is always at risk to dangers from without: the elements and the sea itself are the greatest foe any ship might face. Storms, lightning, rocks, icebergs, whales; any of these outside forces can change the fate of a ship and her passengers in an instant.
But if a cannon* detaches from its bindings, it has such potential force that it risks the lives of the crew, the passengers, and the integrity of the ship from within. It can crush the sailors, break its masts, fall into the body of the ship with such force it can rip through its decks. It is an anarchic, impersonal foe, propelled by physics and mass. It's a mindless force. It's an equal opportunity disaster rolling over everything and anything on the ship, and does not care if it takes the ship down.
This is what the metaphor loose cannon† captures: our ship is pitching in a violent storm. The stays are unfastening. Cargo is becoming unmoored, and the crew is scrambling.
The cannon isn't loosed from its restraints but they are weakening.
We are all in the cannon's path and the ship is stuck at the edge of a typhoon.
*Naval cannons in the age of wooden warships could weigh up 8000 pounds (roughly 3,800 kg) with their mounts (in this case a 36-pounder long gun). Imagine four tons of iron careening around the decks in a storm.
† Loose Cannon history.