Ask a roofer where roofs leak and almost none of them will say "the middle." They leak at the edges and at the interruptions, and the most common interruption on a residential roof is the chimney.
What flashing actually does
Chimney flashing is the metal that bridges two materials with nothing in common. The chimney is masonry: heavy, rigid, carried on its own footing. The roof is a wood-framed assembly that moves with temperature, humidity and load. Where the two meet there is a joint that is always working, and flashing is what keeps that joint watertight while it moves.
Done properly it is two layers, not one. Step flashing runs up the sides of the chimney, one piece per shingle course, each lapped over the one below it. Counter flashing is set into a cut in the masonry above it and folds down over the step flashing, so water that gets behind the surface is thrown back out instead of down. A base pan at the low side and a cricket at the high side handle the water the roof delivers to the chimney in volume.
Why it fails
Metal fatigue is only part of it. Flashing rusts. Sealant at the counter flashing dries out and pulls away from the brick. Mortar joints erode and let the counter flashing loosen. And the constant differential movement between a rigid chimney and a moving roof works fasteners loose over years.
None of that announces itself. By the time a stain appears on a bedroom ceiling, water has usually been in the assembly for a season or more, and the repair is no longer just flashing. It is decking, insulation and drywall too.
The failure that has nothing to do with age
The other common cause is a roof that was replaced without replacing the flashing. Flashing that gets bent back, worked around and re-sealed during a tear-off has already spent its service life bonded to a roof that is now in a dumpster. Its fastener holes are in the wrong places for the new shingle courses, and the sealant holding it is the same sealant that was already failing. Reusing it saves an hour on install day and buys a leak that shows up long after the crew has gone. On an assembly meant to last decades, flashing is not where the savings are.
What to look for from the ground
Rust streaks or staining on the chimney masonry below the roofline
Mortar missing from the horizontal joint where the counter flashing is set in
Metal that has lifted, curled or separated from the brick
Heavy beads of sealant, usually a sign of a patch standing in for flashing that should have been replaced
Inside the house: staining on the ceiling near the fireplace, or a musty smell in the attic near the chimney chase
Any one of these is worth an inspection before it turns into a framing repair. Chimney flashing is one of the cheapest problems on a roof to catch early, and one of the more expensive ones to ignore.