OK, I'm going to show my geekness... HAving had worked for Tim Hortons, here is what I know.
The taste of a cup of coffee is afftcted by a lot of factors:
Where was it grown - Arabian, South American, Hawaiian, Carribbean, etc?
Was it grown using pesticides or fertilizers?
Was it harvested as a "green" bean, or was it allowed to ripen a bit more before being harvested?
How is it processed? There are several ways that a raw bean gets to the point where it is ready to be roasted, and the different methods bring out different nuances of flavor profile.
How long is it "stored" before being roasted. The longer it ages, the heavier and muskier the flavor.
How is it ground - finely or coarsely?
How is it brewed?
How long has it been since it's been brewed?
And finally, you can blend coffee coffee beans before grinding them, to bring out the best of each one's flavor profile.
It's all quite fascinating.
Roasting: As a bean is roasted, it loses moisture (obviously, heat dries things out). As it loses moisture, it loses weight. So lots of coffee roasters use a reverse cyclone method. Basically a lot like the old hot air popcorn poppers where the popped kernels get pushed out by the air, but the heavy un-popped kernels stay down in the hot air until they pop. A column of hot air (set to precise temps closely guarded as secret recipes) tries to push the raw beans up and out of the roaster. Once a bean has lost enough moisture, it is ejected out the top by the column of hot air, and then travels to a cooling area before being either ground or packaged as whole beans.
Edit to add: They have "cuppers" who are people that sample the roasted coffee to be sure it has the right flavor profile. They can tell if the mixture of beans (the blend) is right, or if there is too much Arabica but not enough Dominican, or whatever. They can also tell if it's getting roasted correctly.
When we were on out tour, I asked the cupper if the company ever tests them. He looked at me like "what do you mean? so I said, well, do they ever slip you a cup of Folgers and see if you catch it?" He was not amused. Apparently, using a compeitor's name was taboo, lol