Chemistry - Please explain why dioxygen difluoride is so dangerous
Solution 1:
XKCD's source material is an article from the blog of one of the funnier chemists I've read, Dr. Derek Lowe. The chemical in question made his "Things I Won't Work With" list, and the article is found here.
Dioxygen difluoride, $\ce{O_2F_2}$, sometimes evocatively labeled according to its atomic arrangement $\ce{FOOF}$, is first and foremost a vigorous oxidizer; in plain English, it starts roaring fires with almost anything it touches, even with things that simply will not burn in any other circumstances, like sand, concrete, brick, iron, copper, even asbestos and fiberglass. Both the oxygen and the fluorine are pretty highly electronegative (fluorine is the most electronegative element in the table, and oxygen's #2), and so they will readily react with anything even slightly more willing to donate an electron; carbon, silicon, metals, alkalis, most other gases, etc. When that happens, the high-energy bonds of this molecule (it can only be formed at 700*C, and that thermal energy remains "locked" in the structure of the molecule) are rearranged into structures that require less energy, and the excess energy is released. The resulting rapid, aggressive, highly exothermic reaction of dioxygen difluoride with just about any other material would not be described as anything less than an explosion.
Second, even in the absence of something to oxidize, the oxygen would much rather exist in its "native" diatomic gas state. Again, there's a lot of energy tied up in the molecular bonds of this chemical, and the lower the energy required to form a bond, the more stable the molecule. Therefore, even at extremely cold temperatures (-160*C) in complete isolation, dioxygen difluoride decomposes to oxygen difluoride ($\ce{OF_2}$) and $\ce{O_2}$ gas. At room temperature, this decomposition is uncontrollable (no-one's gotten it anywhere close to RT without it coming apart), and even at extremely cold temperatures, the heat produced by slow decomposition can cause what's called a "thermal runaway"; the heat produced by one molecule decomposing is absorbed by nearby molecules causing them to decompose, releasing more heat, and so on. When things rapidly decompose into more stable gaseous components, the event is normally accompanied by a loud noise and shrapnel, formed from the remains of whatever had been holding the substance and anything else nearby.
Of the products formed by the self-decomposition of FOOF, oxygen gas is a pretty strong oxidizer, but it's the least of our worries here. The other product, oxygen difluoride, is almost as strong an oxidizer as dioxygen difluoride, which is only stronger because it's oxygen difluoride plus more oxygen. The "shared" electron pairs forming the bonds between the oxygen and each fluorine atom are much more closely attracted to the fluorine, as opposed to a structure like water where the oxygen is the more attractive. This gives the oxygen a formally positive oxidation state of +2.
By its very nature, oxygen yearns to flip that sign and achieve its "natural" -2 ox state by bonding with something less electronegative (which, as previously mentioned, is almost everything else in the periodic table besides fluorine). However, unlike the other oxygen atom in the FOOF molecule which flew the coop, this second oxygen can't escape, because the two fluorine atoms won't let it go. The fluorines prefer to bond to it rather than to each other... until something else, anything else, is introduced that's even more attractive.
$\ce{OF_2}$, like its FOOF parent, reacts very strongly and exothermically with almost anything, especially water. It will literally burn ice, rapidly; that's one of the reactions guaranteed to produce a powerful explosion. The most stable ultimate products of that reaction are hydrogen fluoride gas and more oxygen, and when you call HF gas a "stable" product of any reaction you are speaking in very relative terms; a release of HF gas into the air is one of those "drop everything and run" types of industrial accidents. HF gas dissolves in water, including the mucus of your lungs, to produce hydrofluoric acid, a persistent, toxic, corrosive acid that will shred just about any organic chemical it comes across from hemoglobin to proteins to DNA, and you really want to keep those kinds of things intact.
Basically, there are a lot of things in an inorganic chemistry lab that have a Medusa-like ability to kill at a glance, but fluorine deserves special notice, in part because of the number of notable chemists who were poisoned or blown up in the early heady days of isolating it. When you combine it with other elements on the right hand side of the periodic table in "lightweight" combinations (between two and about ten atoms per molecule), your day is about to get reeeeealy interesting; see the work of A.G. Streng, who was tasked not only with producing large quantities of dioxygen difluoride, but also with reacting it with things that normal chemists would keep very far away from it (and in fact "normal chemists" stay very far away from FOOF itself for the obvious reasons).
Fluorine only starts becoming more stable and easier to work with as an ionic salt, such as sodium or calcium fluoride (in which form it naturally occurs as the mineral fluorite; still poisonous in sufficient doses but much less of an explosion/reactivity hazard), or when you start throwing in elements of the carbon group (the carbon-fluorine bond is among the strongest known to chemistry, and fluorocarbons have a variety of uses as propellants, refrigerants and polymers, including Teflon), or heavier chalcogens like sulfur (sulfur hexafluoride, $\ce{SF_6}$, has virtually no reaction chemistry and is favored as a dielectric and to blanket air-sensitive materials, though other sulfur-fluoride compounds like sulfur tetrafluoride and disulfur decafluoride are highly toxic).
Solution 2:
$\ce {O_2F_2}$ doesn't spontaneously combust. It is a supporter of combustion, which means that it's basically a better version of oxygen when it comes to supporting fires.
Basically, when placed in contact with $\ce{O_2F_2}$, other materials spontaneously combust. Here's an analogy: Substances such as nitroglycerin and TNT are like a person with a short temper. They are easy to combust. Substances like $\ce{ClF3}$ and $\ce{O_2F_2}$, on the other hand, are like a person with a knack of making others lose their temper. Mild-mannered on his own, but he can make people around him combust with relative ease.
It still can be prepared, though, because it becomes a lot more mellow at low temperatures. Also, it won't act on stuff which is already a good oxidizing agent (oxygen, ozone, fluorine, sulfuric acid for example), or at least it won't act so vigorously. Coupling these two together, one can probably prepare it in a low temperature environment inside a container lined with a relatively inert material.
Update:
(h/t to KeithS for pointing this out)
Note that $\ce{O2F2}$ has problems on its own as well. It decomposes when on its own to $\ce{OF2}$. Generally, when $\ce{O2F2}$ is oxidising something, it is really the $\ce{OF2}$ which does this (though $\ce{O2F2}$ is strong enough to do the same as well).
After burning something, $\ce{OF2}$ leaves behind some dangerous residues as well, like $\ce{HF}$ (which will eat through most of the material that was saved from burning)
(There are more details in @KeithS' answer)
Solution 3:
It is a very strong oxidizer. That means it can make a lot of materials "burn", i. e. undergo a reaction (oxidation) that releases energy, often in violent ways, because there's so much energy released in such a short time that it has trouble dissipating in any other way than exploding with vigour. This includes a lot of materials that you wouldn't normally consider burnable. Derek Lowe has another article ("Sand won't save you this time", about a similarly hideous substance that's also a fluorine compound), which has some very illustrative examples.
It contains fluorine, which forms many highly toxic compounds that you don't want to have flying around hot and steaming. Even on itself (as $F_2$), it is a gas that's far from harmless.
If you like firsthand stories about compounds like this, and some insight on why people might want to experiment with them at all (although imho, the real reason is they are simply lunatics), I can recommend the book "Ignition!" about rocket fuel research. It's out of print, but PDFs float around the web.