Coffee travels a long, complex road before reaching your cup, but the majority of manual labor in coffee production is done by small-scale farmers.
After the harvest, average coffee farmers are usually at the mercy of only 1-2 buyers who offer extremely low pay. As their coffee is mixed together to save money on shipping, it can pass through anywhere from 2-6 middlemen or more prior to export.
After arriving to your country, it usually heads directly to a coffee roasters or distributor. Then it makes its way to your local coffee shop or grocery store. Each step of the way means that coffee changes hands and someone other than the farmer profits.
Now, there's nothing wrong with profit. Most distributors, roasters, importers, and exporters are not bad businesses or uncaring people. But, with a focus on keeping prices low for their customer (you), the unfortunate result is this:
The average coffee farmer only profits 7-10% from the sale of a bag of coffee at a grocery store and about 1% of the price of one cup of coffee at your neighborhood cafe.
This forces most farmers to make a choice: support their families or invest in their coffee plantations.