The second law of thermodynamics states that the total variation in entropy of a system and its environment is always positive and tends towards zero for transformations tending towards reversibility.
Thermodynamics is based on two essential properties:
-the first principle, which establishes the equivalence of the various forms of energy and in particular heat and work. It is a conservation principle implying that the sum of the various energies associated with a system is preserved even if those energies can be transformed into each other according to their equivalence.
-the second principle, which in addition to energy, introduces another physical quantity characterising the system called entropy. This is a change principle since it determines up to where and in which direction the various energy transformations in the world are possible. Thus, some chemical transformations are possible while others are not. Similarly, not all the heat in a body, e.g. the ocean, can be completely transformed into work.
The second principle has a long history in which names as famous as Carnot, Clausius, Kelvin, Helmholtz, Gibbs and above all Boltzmann figure.
Applied to an isolated system where neither work nor heat are exchanged with the exterior, the second principle establishes that the state function of the system called entropy can only increase to reach a maximum value where the system is in equilibrium. This is a complicated way of expressing the simple observation that any physical system, when left to its own devices, like a living being, tends to become disorganised. This also implies that in any energy transformation in these systems the ability to use the energy to produce work and organisation is lost, this is often referred to as a deterioration in the quality of the energy. This is why this introduces a non-equivalence between the past and the future and an irreversibility of the transformations, and hence an arrow of time.
This raises many questions.
Applied to the universe as an isolated system this would mean that it is proceeding slowly and inexorably towards its "heat death" when disorder would be at a maximum.
Thermodynamics can be deduced from mechanics using certain statistical assumptions but the laws of mechanics are themselves reversible! The arrow of time and the second principle would then be illusions and simple practical, but fundamentally false, approximations.
These issues have still not been resolved today and are the subject of continuous debate.