Schroeder's textbook "An Introduction to Thermal Physics" takes a whole chapter to explain this in detail mathematically. But the basic idea can be stated in a few sentences from the beginning of that chapter:
(that is, processes for which ΔS > 0)
are not inevitable, they are simply overwhelmingly probable. For instance, when heat flows from a hot object to a cooler object, the energy is just moving around more or less randomly. After we wait a while, the chances are overwhelming that we will find the energy distributed more "uniformly" (in a sense that I will make precise later) among all parts of a system.
Suppose we have one mole (6.02 x 10
23 molecules) of an ideal gas in a box. If all the gas molecules were to spontaneously migrate to the left half of the box, that would represent a decrease in entropy. However, this is highly unlikely. If the probability that any single molecule is in the left half of the box is 0.5, then the probability that all of them (one mole of them) are in the left half, and a perfect vacuum in the other half, is ##0.5^{6.02 \times 10^{23}}##, which is a fantastically tiny number. Even if there were only 100 molecules in the box, the probability
Schroeder said:
is iess than 10-30, so you would have to check a trillion times per second for the age of the universe before finding such an arrangement even once.
However, if there are two molecules in the box, the probability is 0.25 that both of them are in the left half; if there are three, the probability is 0.125; etc. With a small number of molecules, it is rather common for entropy to decrease; with a large number (or even a fairly modest number), it is so rare that we might as well say "never" for all practical purposes.
Going further, if we start with all the molecules in the left side of the box, it is generally overwhelmingly probable that they will "spread out" to fill the entire box more or less uniformly within a very short period of time, increasing the entropy of the system in the process.