Whether refried, baked, slow cooked, in a soup or in a burrito, thin and runny beans are problematic in any recipe. Thickening the beans holds them together, when improves the outcome of your dish. There are several ways and techniques to thicken beans.
Simmer down the liquid in which you cook the beans. Using more liquid than is necessary to cook the beans make any bean dish thin, watery and unappetizing. Simmering away the liquid on a medium-low setting dries up the dish while adding flavor. Since you don't want to lose any of the seasonings and spices, add them after the excess liquid simmers off.
Mash the beans since there's plenty of naturally occurring starch inside them. Making refried beans is an example of thickening using the starch inside the beans. Use a potato masher or ladle to mash some of the beans, starting with a quarter cup. The starch inside the beans holds water, letting your dish take on the thickness. The secret ingredient here is heat: without heat, the starch clumps and little thickening takes place Continue heating the beans on low while you mash them until you get the desired thickness.
Add starch. If you want to keep your beans intact, use a commercial starch instead of mashing the beans. Mix a bit of cornstarch and water to make a slurry, and gradually whisk it into the liquid surrounding the beans. Beurre manié, a combination of fat and starch, can be used to thicken liquid-based bean dishes, such as a black bean soup. Kneed equal parts of flour and soft butter together, add it to the liquid, and whisk it in thoroughly.