Every cup in a recipe is a volume: 236.588 millilitres, fixed by definition. What lands on the scale when you fill one is a different question entirely, and for some ingredients the answer is not stable at all.
Three different kinds of number get flattened together in a conversion table, and it is worth separating them.
Physics. A cup of water weighs 236.588 grams, because water is essentially 1 gram per millilitre and a cup is 236.588 millilitres. That figure is not a measurement anyone took; it is the definition restated. Nothing about technique changes it.
Packaging. A cup of butter is 227 grams because that is two American sticks, which are sold as 8 ounces — 226.8 grams, so the rounding is about a fifth of a gram. Again nothing to do with how you fill anything. It is a fact about how butter is sold.
Technique, and this is where recipes go wrong. A cup of all-purpose flour is conventionally 120 grams. That number describes a method: spoon the flour into the cup and level it off. Dip the cup into the bag and pack it down instead and the same cup can hold half again as much. The volume did not change. The amount of flour did, because flour is a powder with air in it and the air is under your control.
That is the whole case for weighing rather than measuring, and it applies unevenly. Liquids barely care — the implied density of honey here is about 1.44 grams per millilitre and it is that whatever you do to the jar. Powders care enormously: cocoa powder implies roughly 0.36 grams per millilitre, less than half the density of water, and it compresses under a spoon.
The flour numbers also show why "flour" is not one ingredient. Cake flour is 114 grams per cup and bread flour is 127, a difference of about 11 percent for the same volume, because they are milled differently and settle differently. Substituting one for the other by volume quietly changes the amount of flour in the recipe before any difference in protein content comes into it.
Sugar is the reverse case and often surprises people: granulated sugar is 200 grams per cup against flour's 120, so a cup of sugar weighs well over half again what a cup of flour does. Brown sugar is 220 because recipes assume it packed, which is the one powder where the convention builds the compression in deliberately.
A note on where these figures come from. The water and butter numbers are definitional and check out exactly: water implies 1.000000 grams per millilitre against the cup constant, and butter is within 0.09 percent of two 8-ounce sticks. The flour figures follow the standard spoon-and-level baking convention. The rest are conventional densities, not constants, and any of them will move with humidity, brand and how the container was handled. A conversion table is a good default and a bad authority.
Cup-to-gram conversions by ingredient are at ingredientcalculator.com.