The story
Connected with both throw things at the wall and see what sticks and throw dirt enough, and some will stick. Regarding this "mud" term in particular, it may possibly reference a technique of building wattle and daub walls by throwing daub (mud mixed with straw) at the wattle, throwing hard enough that some obtained a good key and remained in place; compare slapdash, a pebbledash effect produced by throwing pebbles at a rendered wall.
Etymology from Wiktionary, CC BY-SA 4.0.