I see it all the time. In the picture below, there are drip marks on the floor of the attic. This is a winter phenomenon where warm, moist air from the living space leaks into the attic and condenses on the cold surface of the roof sheathing.
Bellow the insulation is pocked from water dripping from below.
The pattern of drips is frequently from the nails in the sheathing.
Over time the moisture condensing in the attic damages the sheathing. Plywood and OSB siding are the most effected by the moisture, older houses with plank sheathing don’t seem to degrade as much from this condition. The most common type of house is ranch house with truss framing and plywood sheathing. The plywood used for trusses in the 60’s and 70’s was sometimes only 3/8 inch thick. When the plywood degrades enough, it needs to be replaced when new shingles go on. It feels soft when I walk on it and it may not hold nails.
The Trusses above and below are rusted at the gussets and need a structural engineer to review to make sure they still have their structural integrity. Some times, when new shingles are put on, the roofers don’t remove the old, damaged sheathing and just add another layer of sheathing over the top of the old sheathing, This is a bad idea.
But what about the causes. First, moisture laden air leaking into the attic. It gets in through an unsealed, uninsulated attic hatch or better a pull down stairs. Bathroom vent fans frequently are vented into the attic instead of to the outside through the roof. Air also leaks through the openings around lights and electrical fixtures in the ceiling, especially recessed lights.
That is part one of the cause–the air leaks into the attic. Part two is a lack of ventilation in the attic that prevents the air to vent out before it condenses.