Snakes - not just venomous snakes - eat a huge number of rats, mice, and other pests. Cobras in particular have a long history of interactions with humanity. Some monasteries in India make pets of them - leaving food out for them (they like milk) and providing them with space to bask in the sun - because they are so beneficial.
There are only a couple of venomous snake species that are aggressive toward humans. Most of the time if a snake knows a human is there, it will try to hide.
“There are only a couple of venomous snake species that are aggressive toward humans.”
That explains a lot.
Our USMC Infantry son and many others were enjoying a pleasant ocean cruise when the massive tsunami hit Sri Lanka in 2004(?)
They were redirected to Sri Lanka for humanitarian support.
They set up camp near the town, the connecting road was out of the way and the Marines walked directly to the town.
Until the locals pointed out that the mounds in the field were cobra nests!!!
No cobras were injured.