The ridge is the capping that runs along the apex of the roof, bedded on mortar over the top course of tiles or slates on each slope. Hips, the sloping external corners of a roof, are finished the same way. That mortar bed does two jobs: it holds the ridge tiles in place against wind uplift, and it seals the junction where the two roof slopes meet, which is one of the wettest points on the entire roof. When the mortar fails, both jobs stop happening at once.
Repointing is not simply smearing fresh mortar over the cracks in the old. Done properly, it means raking out the failed material back to sound bedding, cleaning the joint, and rebuilding it with a mortar mixed and gauged for the job, strong enough to hold the ridge secure, but not so strong or so impermeable that it cracks the ridge tiles or traps moisture underneath them. Where the bedding itself has failed rather than just the pointing, the ridge tiles are lifted, the old mortar removed entirely, and the ridge is re-bedded from scratch on a fresh mortar bed before pointing.
We see two patterns of failure most often. The first is age and weather: lime or cement mortar exposed at the highest, most wind-loaded point of the roof for twenty or thirty years eventually cracks, shrinks and lets water in, and each freeze-thaw cycle through winter widens the crack. The second is a mortar that was wrong for the job from the start, too rich a cement mix that has no give in it, bedded too thin, or applied to a ridge that was never properly cleaned first, so it never bonded. Both look the same from the ground: hairline cracks, loose ridge tiles, and pointing that has visibly lifted or gone missing in short lengths.