Working at a range, I see all sorts of firearms fail. Bad ammunition and no maintenance are often the cause, but sometimes it comes from the firearm being poor quality.
In the case of one Bushmaster, it work well for years, but finally one day the corners the company cut caught up to it and the gas key worked it way loose. That caused the gun to become a single shot.
A woman who owned a Olympic 9mm carbine found that the mag block had shifted and it would no longer accept a mag, also the castle nut on the stock was loose and the collapseable stock starting to unscrew. Unfortunately I forgot to take photos of that mess of a rifle.
Home built hobby guns often have similar issues. One rifle that I was asked to help the owner with surprised me when I found there was no firing pin in it.
Other times, the issues are caused by junk ammo. For example this doublefeed & failure to extract:
Note that there is a round in the chamber, an empty shell, and another round attempting to feed. The owner of this rifle bought some ammo from a random gun show vendor. This ammo was inconsistent length, one of the round had a split neck, and some of them would not even chamber. Bad ammo results in bad performance.