Not embarrassing -- dangerous. She is going to damage her teeth, hurt her gums and possibly swallow a metal piece that ends up with you taking her to the ER.
She finds the pencil -chewing pleasurable and it probably relieves stress and helps her focus (I would bet her school pencils are chewed up too). Because she is nearly eating these things, I would get her evaluated as soon as you can by an occupational therapist who specializes in kids.
Here's why: My friend's son chewed pencils and erasers like mad until he started seeing an OT, who discovered that he really, truly needed some oral help in order to concentrate at school; the boy and his parents and the OT worked with the school to get the boy on an education "plan" document that allows him to chew during the school day; he used to use "chewies," which are items designed to be chewed and available through therapists, and now that he's older he is permitted to have gum in school. The boy is MUCH more calm and focused when he is allowed to chew -- it's not a "bad habit," it's simply the way his brain is wired and it's easily diagnosed and dealt with. The fact that your daughter mostly chews while doing homework (how much does she have, at five? Is that a source of stress to investigate?) could indicate that she has a strong need to chew or have other oral stimulation while focusing her mind.
This condition of focusing better while chewing or sucking on something is not at all unusual. So don't think anything's terribly wrong --she just may need to do this. But she could use an OT evaluation -- it couldn't hurt just to do it and see if this is mere habit or truly something that needs attention before she hurts herself.
I would talk to her teacher ASAP to see what's going on in school because I'd be concerned about her teeth and the very real possibility of swallowing pieces of wood, eraser or metal. (I hate to think what a sharp sliver of wood could do to a gum or even a stomach.) See if she can be allowed to chew something more appropriate if she's doing it at school (unfortunately if she's in K they will probably not allow that unless she has a formal letter from an OT and an education plan document permitting it; they won't let a K student chew gum etc. or all the others will whine about "Why can't I do that?" At older grades it's easier for teachers just to tell kids, "He gets to do it, you don't.")
Meanwhile, during homework time -- introduce her to gum ASAP!