Difficulty is the network's thermostat. If hash-rate rises and blocks come too fast, difficulty goes up; if miners unplug and blocks come slowly, it falls. The adjustment keeps block-time near its target regardless of how much hardware is running.
Because difficulty only changes on a schedule, it lags reality. That lag is the mechanism behind miner-capitulation: a price crash makes marginal miners unprofitable immediately, but relief only arrives at the next adjustment.
Example: Bitcoin readjusts every 2,016 blocks, about two weeks. If blocks averaged twelve minutes instead of ten during that window, difficulty drops roughly 17% at the reset, restoring the ten-minute pace.
Related: hash-rate, proof-of-work, block-time