Thermal equilibrium occurs when two systems in contact with each other cease to exchange heat, resulting in the same temperature throughout both systems.