Usually because you've done a bit too much, too soon — more distance, more days, or harder surfaces than your shins are ready for. The muscles and connective tissue around the shin take longer to adapt than your heart and lungs, so your fitness can run ahead of what your legs can absorb.
The common fixes are simple: build up gradually, slow your easy runs down, and don't add distance and frequency in the same week. Mild ache that settles is usually just adaptation. Sharp, worsening, or one-spot pain that lingers after you stop is worth getting looked at by a physio before it becomes a longer layoff.