Because people are carless and don't weed out the males early enough if at all and they females produce seeds. Or some females turned hermie because they were grown horribly or they had awkward genetics.
Usually in commercial grows some plants may hermi during the flower period... (hard to check hundreds of plants)... which is good considering about 1/2 the growers out there are using them.. my av pic is a bagbean.....
if you buy a bag and its loaded with beans like every bud then it was probly grown outdoors and the males were not culled.
if its only a couple of beans in just a few buds not all buds then it was probly a hermie or a male caught late.