Most everyone knows what the common turn of phrase all bets are off means: "anything can happen." But all idioms have to start from somewhere, and the question I'm wondering is how did this one start. Google informs me it comes from a gambling context, and I'm inclined to believe that, having seen the movie Snatch, but what I'm not understanding is how the literal meaning of "all bets are off" -- that is, the house will not be taking any bets today -- would have evolved into "anything can happen." Can someone enlighten me to a plausible pathway?
You asked for a plausible development, so here goes... note that I can't prove that this is how it developed, but I've at least tried to give a genuine usage example of each of the senses in the sequence, with dates where possible.
(i) This phrase was originally used in betting on sports, and in particular horseracing. The meaning is that not only is the bookmaker not taking any more bets, but that existing bets placed on the competition are null and void. This is usually because the race has been cancelled, but can also be due to other factors - for instance, the starting lineup changing so substantially that forcing people to honour their bets would be unfair, or in the event of an irregularity in the conduct of the race. (It can also be because the event was drawn.)
Here is a modern example in horseracing rules:
Bets are off and any stake paid shall be returned to the investor in the following circumstances - [...]
[ ...furthermore... ]
(1) If, in the opinion of the stewards, bets have been or may have been affected by fraud or corrupt practice, they may declare the bets off.
(2) In the event of a race being rerun all bets are off.
Or it can refer to a draw (1897):
An honest judge will be compelled to decide that the race is a drawn one and all bets are off.
Or an irregularity (1901):
...you hired some man to frighten my horse. Of course we either run again or all bets are off.
Or a change in the starting lineup (1839):
Grey Milton is also disqualified for the High Ash [...] Unless coupled with other horses, all bets are off.
Or because of misinformation about the race (1881):
As in the racing world all bets are off when the horse that wins has been erroneously described, ...
I believe that the phrase became embedded in people's consciousness, since at racecourses (and other sporting events) it would commonly be announced "The 14.35 has been cancelled; all bets are off." However, given the oral nature of such announcements, it is hard to track down any evidence, so this is largely speculation, but it is still occasionally used in a manner consistent with this, for example (2009):
The FED needs to announce "All bets are off" concerning the Credit Default Swap 'insurance' scam.
(i)(a) By direct association, the phrase is often used by the media with the implication that the event in question has been cancelled (2008):
All bets are off at Cheltenham as racing postponed due to high winds
Organisers of the Cheltenham Festival have had to cancel the second day of racing after overnight storms
(ii) From the first meaning ("bets are null and void") is derived a sense of all existing agreements are cancelled: that there is a return to the status quo ante, because even existing bets are not honoured (although the stake is returned). Examples of this usage are hard to tell apart from the meaning in the next paragraph, so I have put them all together there.
(iii) Following on from that (and no doubt assisted by the similarity of the phrase the gloves are off), the phrase is applied to situations where the circumstances have changed substantially, to the extent that former truces, alliances and restraint no longer apply.
This can mean that former commitments of non-aggression are discarded (2010):
"[...] if we see states developing biological weapons that we begin to think endanger us or create serious concerns, that he reserves the right to revise this policy [of not using nuclear weapons]."
Clinton added, "If we can prove that a biological attack originated in a country that attacked us, then all bets are off."
Or an amnesty is cancelled (2009):
ATO offers amnesty [until June], then 'all bets are off'
Or former leniency will be reversed (2011):
[after not sending Clarke to prison for a long time] The judge warned Clarke, who has a long criminal record: "The next time we meet, all bets are off and you will go inside, do you understand?"
Or indeed that rules no longer apply (2011):
There is a well-marked area about 30 feet beyond the Start Line, where all bets are off, and there are no speed restrictions.
(iv) Of course, a consequence of this is that, since the rules of the game have changed, there is a sense that "anything can happen" in that what was previously unthinkable is now entirely possible. This sense, probably combined with one aspect of the original meaning (i.e. the circumstances have changed such that former bets/predictions are void), then leads, finally, to the definition quoted in the question - basically the situation is unpredictable and anything could happen.
For our last example, where better to find unpredictability than in the economy (2010):
"The only consensus is that no-one knows what will happen [...] Retailers we've spoken to have all said the same - performance will be slow but steady until summer, then all bets are off until the first budget post the election."
A couple of scenarios occur to me. One is that the phrase would be used at the end of the period of taking bets: before spinning the roulette wheel (along the lines of "Les jeux sont faits", which I believe is the traditional phrase used there) or before the horses/dogs start. At that point, the bets are made, and yet anything can happen before the finish line.
The other possibility is that the projected outcome is so unpredictable that the house doesn't feel confident in taking any bet at all - it isn't even able to assign odds.
To me, the meaning has always been transparent: nobody would take any bet, since the whole situation is so uncertain.
I believe the complete phrase is "all bets are off the table" meaning that the event has so many variables that there is no way to have any form of organized gambling, and so spectators would make bets between each-other that cannot be declared on an organized gambling table. Similar to expressions like "nothing is off the table" and "getting paid under the table."
I'd say the connection is more direct, via another use of "bet".
"Tom is betting that his boss will be promoted next month."
This means that Tom firmly believes that his boss will be promoted next month and has taken action (or at least made plans) that can only succeed if his boss is promoted next month. Usually, this belief is the result of deep analysis, insight, or inside information.
It's not guaranteed, and implies that the one betting does not have direct control over events. Tom cannot promote his boss, and cannot control whether his boss will accept the promotion, but he is persuaded by his analysis, or rumors he's heard, that it is very likely to happen, and he's taking a risk based on that probability.
"The race has been cancelled, all bets are off."
What each bettor was persuaded would happen is now impossible. There is no race, and they no longer have a basis for their previous beliefs.
Thus, "The president has resigned, and now all bets are off", combines these: the race that was to be has now been cancelled, so the "bets" of those observing the race are now without meaning.
Speaking as a former (1963) craps dealer at Harrah's Tahoe casino, now an attorney (Harrah's hired law students as craps dealers), bets are toggled as either on or off, in play or not, on the come-out roll.
The reason: On the come-out roll, seven is a winner, but only at that time. Other bets lose. So on this roll, the shooter hopes for a seven to win the new bet, not to lose his preexisting ones still on the layout from the previous round. I'll explain:
When other bets remain on the layout, as happens when the shooter has won his point on the last roll and has the right to roll again, making a new bet and establishing a new point to try to make again and win, the shooter does not want those other bets to fail when the lucky seven appears on the come-out roll.
In that case, either the shooter, or automatically by house rule, may declare that these bets are "off" meaning not in play, during the come-out roll.
You'll see the word "off" printed on the buck, the circular puck on the table which is used by the dealer to mark "the number" which the shooter must match to win his point. The other side reads "on." This is flipped to indicate the status of preexisting bets on that roll.
The term "all bets are off" has entered the language to mean, for example, that an agreement is suspended during some defined emergency or dire circumstance as provided, say, in the agreement, like war, or force majeure.
There are more complex answers here that are correct, but to simplify the answer, one may note that a "bet," is a prediction. When something is off, idiomatically, it is -not- "unpowered," which is literal, but it is no longer valid.
The idiom is actually two idioms put together, "to bet," and "its off." e.g. "I bet it will rain," and "the wedding is off." Thus, idiomatically, the phrase all bets are off means "all present predictions are invalid," and further, "future events are unpredictable," or as OP states "anything can happen."
The idiom is usually applied after new information causes a change in conditions unknown previously.
While idioms such as "where's the beef," have a knowable birth, such as advertising and politics, I suggest that the evolution of the all bets are off idiom occurred naturally through usage, and not because of any singular historical event or particular series of events in gambling on sports, even if sports gambling is the obvious origin of the phrase.
It is derived from craps. Certain bets can be carried forward or turned off from one roll to the next. If someone tells the croupier/dealer all bets are off prior to the next roll then all the bests that person has laid on the table that can be turned off are no longer in play for that roll, even though they still may be physically on the table. The expression has come to mean i don't have confidence in the outcome or it's too close to call, so I am not going to bet the event; the next roll, a sporting event, a business deal..... - all bets are off.