A stovepipe is usually caused by a weak round that causes your gun to short stroke. Certain aspects of the ejection are affected by how vigorously the action is driven to the rear (angle, case spin, how forcefully it ejects on some designs, etc.). Most importantly, it affects the timing: how long the case has to clear the action before it slams closed again, where on the case the extractor impacts, and what the bolt is doing when it reaches the ejection point (whether it's still moving quickly to the rear or whether it's slowing down to a near stop). If it short strokes, some important aspect of the ejection is going to get thrown off, and the proper spin may not be imparted, the ejector may not hit it forcefully, or something. One way or another, the case does not clear the action.
Beyond stovepipe, there are a few main malfunctions:
Failure to Feed: the bullet did not properly extract from the mag and got jammed while feeding.
Failure to Eject: Stovepipe is but one kind of failure to eject. This is typically caused by weak loads or an underpowered ejector spring.
Failure to Extract: The extractor pulled off the rim, leaving the case sitting in the chamber. This typically happens with a split case. Sometimes it will extract, but absorbs so much of the recoil that you instead get a simple Failure to Eject.
Failure to Fire: Either the ammo has a bad primer, or your firing pin needs a stronger spring.
Note that I've seen the abbreviation FTF apply both to "failure to feed" and "failure to fire". Or, more generally, "failure to function". Typically it means "failure to function" which means some unspecified problem occurred.