If one digs a pit in the public domain and an ox or a donkey falls into it, he is liable to pay the damages.Whatever shape one digs, he is liable to pay for the damage his excavation causes. If so, why is specifically a pit mentioned in the Torah? Just as a standard pit has sufficient depth to cause death, being ten hand-breadths deep, one is liable for any obstacle that has sufficient depth to cause death.
One is not liable for the death of a donkey in a pit less than 10 hand-breadths but is liable for the injury.
Art: Peasant Children with Donkeys by Edgar Bundy