I just ate a protein bar with coffee beans in it. I get that it is a good energy source and it tastes like coffee but is the coffee beans prepared in a certain way. I'm not quite sure if they are edible raw or what the beans have to go through. So how does raw coffee beans become edible coffee beans that can be put into all sorts of foods? Or are coffee beans left raw or even both? Please use reliable sources and all help is appreciated!
Roasted coffee beans (from which you'd brew coffee as usual) are certainly edible -- chocolate-covered coffee beans are an example. They don't need any different or additional processing beyond ordinary roasting; I'm guessing that was what was in your bar. Chew a whole roasted coffee bean; does it taste similar?
If you're asking about green beans, a quick search suggests that raw coffee beans contain some questionable chemicals; however, this question about the edibility of coffee cherries seems to indicate that they're not harmful...
You can eat coffee cherries, but they don't taste like coffee and have some laxative properties, so you may not want to eat very many.
You have encountered some snacky treats with coffee as a dry ingredient. Those are delicious. They are generally made with coffee beans rather than the coffee cherries; the coffee bean, already roasted, is ground to a fine powder and mixed in.
Coffee processing includes picking, drying, pulping, washing, roasting, and then the parts we're familiar with-- grinding and brewing. You can read more on the process here: http://science.howstuffworks.com/innovation/edible-innovations/coffee5.htm