Permanently crosslinked polyelectrolyte gels are known to undergo discontinuous first-order volume phase transitions, the onset of which may be caused by a number of factors. In this study we examine the volumetric properties of such polyelectrolyte gels in relation to the progressive substitution of monovalent counterions by divalent counterions as the gels are equilibrated in solvents of different dielectric qualities. We compare the results of coarse-grained molecular dynamics simulations of polyelectrolyte gels with previous experimental measurements by others on polyacrylate gels. The simulations show that under equilibrium conditions there is an approximate cancellation between the electrostatic contribution and the counterion excluded-volume contribution to the osmotic pressure in the gel-solvent system; these two contributions to the osmotic pressure have, respectively, energetic and entropic origins. The finding of such a cancellation between the two contributions to the osmotic pressure of the gel-solvent system is consistent with experimental observations that the swelling behavior of polyelectrolyte gels can be described by equations of state for neutral gels. Based on these results, we show and explain that a modified form of the FloryHuggins model for nonionic polymer solutions, which accounts for neither electrostatic effects nor counterion excluded-volume effects, fits both experimental and simulated data for polyelectrolyte gels. The Flory-Huggins interaction parameters obtained from regression to the simulation data are characteristic of ideal polymer solutions, whereas the experimentally obtained interaction parameters, particularly that associated with the third virial coefficient, exhibit a significant departure from ideality, leading us to conclude that further enhancements to the simulation model, such as the inclusion of excess salt, the allowance for size asymmetric electrolytes, or the use of a distance-dependent solvent dielectricity model, may be required. Molecular simulations also reveal that the condensation of divalent counterions onto the polyelectrolyte network backbone occurs preferentially over that of monovalent counterions.