The question is posed wrong. Arsenic is a chemical element. On earth, it is not "formed"; heavy elements in the solar system are all remnants of former star systems gone nova. I guess the question is how mobile arsenic (relevant for groundwater quality) is formed.
Arsenic in groundwater is released from cristalline rock (such as granites) at significant but comparably low concentrations. The original arsenic bearing minerals are often pyrite and other sulfides. In these environments, oxidation of the sulfides is needed for mobilization.
The highest geogenic arsenic concentrations in groundwater on large scales are found in holocenic sediments of river deltas in south-east Asia (Bangladesh, Vietnam, Combodia). The release of dissolved arsenic is strongly related to reducing conditions which are common in these aquifers. Under oxic conditions, the arsenic is sorbed onto ferric iron-oxides/-hydroxides. The exact mechanisms of arsenic release under reducing conditions are still debated but a clear relationship between redox and arsenic concentration has been established (brown, oxidized sediments = low dissolved arsenic; gray, reduced sediments = high dissolved arsenic). In the older, pleistocenic sediments, arsenic has already been washed out. Thus, the probable process chain is: (1) erosion of arsenic-bearing rocks (granites) in the Himalayas, (2) sedimentation in the river delta, (3) oxidation of the sulfide and sorption onto ferric iron hydroxides, (4) release of the arsenic under reducing conditions.
The Swiss Federal Institute of Aquqatic Science and Technology - Eawag has developed methods to predict the worldwide risk of arsenic groundwater contamination (see http://www.eawag.ch/forschung/qp/wrq)