A Scientific American article asks, regarding the second law of thermodynamics: “if the world is steadily becoming more disordered, how do you explain the self-organization that often occurs in nature?” [Link]
At root, the trouble is that classical thermodynamics assumes systems are in equilibrium, a placid condition seldom truly achieved in the real world.
A new approach closes this loophole and finds that the second law holds far from equilibrium. But the evolution from order to disorder can be unsteady, allowing for pockets of self-organization.
The article goes on to say that “the second law is universal but also found that it is not nearly as gloomy as its reputation suggests,” because “it applies only when the system under study is in a quiescent state called equilibrium,” i.e. “thermodynamics…deals only with situations of stillness.” However nature, generally, isn’t standing still, but is in a persistent state of flux (ask any buddhist). The conclusion of the article:
…the development of order from chaos, far from contradicting the second law, fits nicely into a broader framework of thermodynamics. We are just at the threshold of using this new understanding for practical applications. Perpetual-motion machines remain impossible, and we will still ultimately lose the battle against degeneration. But the second law does not mandate a steady degeneration. It quite happily coexists with the spontaneous development of order and complexity.