In processing plasmas, the ion distribution functions are generally non-Maxwellian and spatially varying. We have used the NRL axisymmetric particle simulation code QUASI-rz to calculate ion distribution functions at various positions in the plasma, for an ECR discharge in Ar/Cl gas mixture. We show that the distribution functions are determined by an interplay of several processes: ion acceleration due to the diverging magnetic field, or to the pre-sheath electric field, charge-exchange collisions, and Coulomb collisions between ions. Omitting any of these processes from a model radically alters the conclusions.