Your question seems to proceed from the assumption that ships from the losing fleet would be sunk, which in fact was often not the case. Ships could be captured, could be driven onto shore or rocks or reefs, could be disabled and captured later, or could flee entirely.
For example, in the battle of the Nile (1798), of 13 French line-of-battle ships present, one was sunk (Sérieuse), one blew up (L' Orient) and nine were captured. About 2,000 French sailors were killed, half aboard L' Orient, and about 3,500 captured. Of the captured, some were paroled and some were kept as prisoners. The large Franco-Spanish casualties after Trafalgar are mainly because of the severe storm that blew up after the battle, sinking many of the damaged and captured allied ships with their crews still aboard.