One cause is the direct dumping of dry flour, cornstarch, or other thickener into the hot stock or broth. Another: adding broth too quickly into a roux—the flour-fat mixture that some gravy recipes start with—which can cause clumping or a gluey layer on the bottom of the pan. Hot spots in a large pan can complicate things, as well. In any starch-based sauce, the thickener needs to be gradually introduced to the hot liquid it's supposed to thicken. The easiest way, as with our recipe for the Mushroom Gravy, involves whisking a flour slurry into the broth mixture, then stirring until the gravy comes together.
If lumps happen, pass gravy through a sieve or strainer, or puree it (with an immersion blender or, very carefully, in a regular blender). If the gravy originally contained sautéed mushroom slices, well, the guests needn't know that, and it will still be delicious.