A gas in a box can be described by a handful of numbers, such as temperature and pressure, but an enormous number of arrangements of its molecules are consistent with them. Ludwig Boltzmann defined entropy as the logarithm of that number,
The second law of thermodynamics says the entropy of an isolated system never decreases, which is why heat flows from hot to cold and spilled milk does not unmix.
In 1948 Claude Shannon defined the entropy of a message in the same form, as a measure of uncertainty: a fair coin toss carries one bit. That shared mathematics is why machine learning trains classifiers with a cross-entropy loss, and why maximising entropy, subject to what is known, picks out the least biased probability distribution.