It depends on the ones you get. The term “protein bars” tends to cover a whole range of types. I am hypoglycemic, I find that the ones that are nut and grain intensive are really good for staving off goofiness when I am late for a meal.
Way back in the day I used to make my own, but it was really messy, now I buy them.
Some are literally candy bars. Others are pretty damn good and healthy. I still love plain old cliff bars for when I’m doing intense exercise. They just work by providing you with sustained energy. Meal replacement bars are something else. Diet bars are something else also. All fall under the “protein bar” umbrella.