What can do to prevent a child from biting their fingernails?

Muvala. You can paint muvala on their fingernails. It's a nontoxic, safe but very bad tasting clear nail polish.
Misdirection. I suggest getting the child their own emery board. This will allow the child to "file" their nails gently whenever they feel the urge to bite their nails. They can polish and shine the nails instead of biting. Just another one of the areas of "misdirection or redirection" we try with our kids.