The first law of Thermodynamics provides the means for accounting for energy, but it gives no hint as to why a particular process occurs in a given direction. A process is considered to be spontaneous if it occurs without outside intervention, and the driving force for a spontaneous process is an increase in entropy. We can define entropy as the measure of randomness or disorder and entropy can be expressed mathematically using macro/microstates and we can also compare the entropy of various systems.
19.2 Mathematical Definition of Entropy