A few explanations at the cellular and molecular level:
First, for contraction to happen, muscles need signals from nerves. Replenishing the pool of neurotransmitters (used for each synaptic burst) takes a bit of time, and short-term exhaustion may happen at this level.
In the muscle cells, contraction is caused by a calcium release within the cell, from a cellular compartment called the sarcoplasmic reticulum. This reticulum can only contain so many ions, so if the muscle contracts a lot, it will eventually need to rest for a while to re-accumulate calcium in the sarcoplasmic reticulum to prepare for more contractions.
Muscles need molecular "fuel" (like ATP molecules) to contract/relax. After an intense or sustained effort, these molecules are partially consumed and the muscle simply runs out of energy; it needs a bit of time to resore the pool of metabolites needed to work properly. Conversely, muscle contraction also causes the accumulation of metabolites and ions like potassium, which partially inhibit muscle contraction. Fatigue occurs when these accumulate at high level, and they must be cleared before making new efforts.
For references see: