Things like flour, powdered sugar, cornstarch, cocoa powder, or any other powdery dry ingredient can cause the most issues when measuring by volume. To prevent this, there is a proper way to measure these ingredients.
Start by stirring and fluffing up the ingredient with a spoon. This helps to aerate it a bit and break up any clumps.
Lightly spoon the ingredient into your measuring cup, overfilling it, and being careful not to pack it down at all.
Use the handle of the spoon or a knife and level it off. This gives you a nicely measured dry ingredient.