The child may pick up a toy, swing it about and accidentally hit the cat sitting close by. Children at this age are not yet capable of understanding that they now have a superior strength. Constant adult supervision is needed until the child learns the rules involved in dealing with the cat. If you always let the cat go, it will always come back to you. As long as the cat can leave if it wants to, it will never have reason to scratch.
Cats scratch only as a last resort if they are extremely upset and frightened.
As a note, the above information is intended for adult cats and children. The situation is different with kittens. It is recommended by most veterinarians and shelter personnel that you not bring a kitten into a household with toddlers. Little children with the best intentions and kindest hearts in the world can maul a kitten to death, literally. All it takes is one moment of unsupervised contact for the kitten to be severely injured or dead and the child to be faced with the guilt of their actions.