@Account Closed
This sounds like a very simple question but actually it's not. There are many different factors you need to look at.
Scenario 1: I as a homeowner and I put a claim in for damage to my roof. My insurance carrier decided it was necessary to replace it and paid for that replacement. Instead of replacing the roof I only patched the "really bad" areas and pocked the rest of the money. (Many people do this.)
6 months later my roof leaks again and I put another claim in to my insurance carrier. They inspect the roof and see that even though they paid to replace the roof I only patched it. They WILL NOT pay to repair this roof because they already paid to replace it. In effect they would be paying for the exact same material/ damage that was previously paid for.
Scenario 2: I as a homeowner and I put a claim in for damage to my roof. My insurance carrier decided it was necessary to replace it and paid for that replacement. Instead of replacing the roof I only patched the "really bad" areas and pocked the rest of the money then sell my house.
The new home owner owns the house for 6 months and it leaks. They put a claim in to their insurance carrier. (unlikely to be the same one but would not really matter if it was)
This damage would be paid for so long as it was caused by a covered peril within the policy.
Now, as for replacement of the entire roof. You are correct that most likely if they paid to replace the entire roof then it needed it. However, this is not always the case. It depends on what caused the damage, the amount of damage and where the damages are located on the roof. If all the damages are on 1 single elevation then really only that elevation needs replacement. (Assuming the remained of the roof is in good condition and not too old.) If damage is on all elevations but is only minimal damage to each elevation it is possible that the insurance carrier would pay to replace the entire roof even though it's not necessary. This is only if no other previous patches existed on the roof. If there are older patches on the roof you are very likely to get paid to patch it again from the insurance carrier.
There are more factors that go into it but this is a quick down and dirty overview. If anything was not clear let me know and I will try to explain it better.