The ball looses potential energy as it rolls downhill. At the bottom of the hill it has zero potential energy. This same idea can be applied to chemical potential. The marbles are no longer in an ordered state. No matter how much you shake the box, the probability of getting back to three layers of single colors is next to zero.
All spontaneous processes move toward equilibrium.
This state is the thermodynamic definition of a system at equilibrium. While there are exceptions, exothermic reactions usually take place spontaneously and endothermic reactions do not. The products of an exothermic reaction have less energy than the reactants, therefore the reaction occurs naturally to reach a lower state of energy. Since temperature and pressure affect enthalpy, you should be aware of two more reaction types. Isothermal reactions take place at a constant temperature.