The repulsive interaction between oppositely charged macroions is investigated using Grand Canonical Monte Carlo simulations of an unrestricted primitive model, including the effect of inhomogeneous surface charge and its density, the depth of surface charge, the cation size, and the dielectric permittivity of solvent and macroions, and their contrast. The origin of the repulsion is a combination of osmotic pressure and ionic screening resulting from excess salt between the macroions. The excess charge over-reduces the electrostatic attraction between macroions and raises the entropic repulsion. The magnitude of the repulsion increases when the dielectric constant of the solvent is lowered (below that of water) and/or the surface charge density is increased, in good agreement with experiment. Smaller size of surface charge and the cation, their discreteness and mobility are other factors that enhance the repulsion and charge inversion phenomenons.