A Cat D is where the total cost of repairs DOESN'T exceed the vehicles PreAccident Value, but they are close, so the insurer takes the economic decision to write off (rather than commit to repairing, when further damage will no doubt be found). They also get more money for the salvage, so can cut their loss that way.
If you are interested, need to find out if this car has actually been written off. That is, has an insurance company instructed an engineer to inspect the car, did they write it off and then put it on MIAFTR, which is the insurance database for written off vehicles, or have DVLA been informed. If so, the history will always be there and affect it's future value and you would be wise to have it re mot'd once repaired to show to anyone that you have repaired it properly.
If it hasn't gone on MIAFTR or DVLA notified, then once repaired, no-one will be the wiser and you need not get another MOT, except perhaps for your own piece of mind!
If it has been written off and he's done a deal with the insurers for him to keep the salvage, he would have been charged about 10% of the pre-accident value for it. So say they valued it at £2000, they would have paid him £1800 and he keeps the car (valued at 10%, so £200, so he's got £2000 all in).
So it's worth about 10% of it's pre-accident value!