Competitive microbial and geochemical processes controlling the fate of arsenic