I doubt it was your fingernail - that's too much blood for a small scratch. More likely it was the sharp edges of the cracker and her either trying to move it around or clamping down on it. She probably broke off or bit off too large a chunk.
Either way, there are a lot of blood vessels in the mouth so bleeding isn't unusual. Mix it with added saliva, and it looks like more blood that it really was. And, you quickly realized that she was crying and therefore still breathing - pretty good in a sudden situation - way to stay calm, Mama! And, of course, you did the right thing, and she's fine.
I'd probably try to find something else for her to chew on and practice eating with. She's growing, getting more confident, and having better motor skills, so she's probably doing more with a cracker she used to just suck on or gum around with.