Here's a little diagram I made using some pictures from Google search into an easy-to-understand diagram.
At the same time also, I got into coffee roasting at home. I learnt that any part of the process above, either from planting the coffee bushes, until final step where the roasted beans got into our hand, will have an impact on the final cup quality. For example, if the green coffee beans are not stored at proper temperature, or if the roasting proccess got screwed up, or if the beans are not harvested selectively, either way, we will end up with an inferior coffee. So that's a very thin line we're walkingthere. And even we did perfectly until the roasting step, with the wrong parameter in brewing, we will STILL ruin the coffee. So you get the idea- every step has to be perfect (or at least as close as humanly possible).
Next are some pictures I took from a Ethiopia Yirgacheff I roasted recently. These are bean defects and I will try to link to the possible cause.
Figure Above: Irregular beans - probably due to harvesting process
Figure Above : Empty Shells - Most likely due to sorting process
Figure Above : Small/Mini Beans (Normal beans on left) - May be the plant is not fertilized enough, or just variation of the coffee plants
Figure Above : Coffee Shards/Pieces - Could be due to transport or harvesting. Sometimes due to rough handling of roasted coffee
Figure Above : Cut Beans (Normal beans on left) - May be cut by harvesting machines
Figure Above : Bug bites (Normal beans on left)- A good sign that they're not abusing pesticide? Haha
Figure Above : Unsure(Bug or cut?)
Figure Above : Quakers (Normal beans on Left)- these are beans that appear yellowish even after being roasted. May be due to immature beans harvested
Figure Above : After picking out all the beans defects
The next time before you grind your beans, just have a closer look at the beans. Are they regularly shaped? Any defects you could detect? If they look healthy, be grateful (I do!) that the person prior to you has taken their best effort to ensure beans arrived in your hand perfectly, it's not easy feat. Cheers!