These guys have been around for a while though I haven’t traced them back to their origins yet. The earliest example that immediately comes to mind are the pit zombies Ash fights in Army of Darkness. We’ve seen them recently used on the Walking Dead where they really serve an interesting purpose. They were essentially in the pits because that was the best place to keep them until they were used to attack the prison. In this way, pit zombies can be viewed as being similar to cattle. (I would say the famous well zombie from the Walking Dead is simply a variation on a type and is just another pit zombie.)
However pit zombies could happen by chance simply by zombies getting stuck in a depression in the ground over time. They could end up in there if the depression is a defensive unit like a moat. In Army of Darkness we see them used like pit dogs. You basically capture an enemy and throw them to the dogs in the pit or in this case the zombies. It’s a sort of weapon.
They pose a real risk for anyone keeping them in that they are continuously scratching at the walls and trying to make their ways out. Over time, if they keep building up they could climb over one another or break down the pit walls and get out leaving you with a lot of hungry biters right at your doorstep. If used correctly though, pits are a good way of dispatching a group of zombies. Let a bunch of the clumsy things get down into the pit and then dispatch them outright.