The swelling and compression of hydrogels in polymer solutions can be understood by considering hydrogel-osmolyte-solvent interactions which determine the osmotic pressure difference between the inside and the outside of a hydrogel particle and the changes in effective solvent quality for the hydrogel network. Using the theory of poroelasticity, we find the exact solution to hydrogel dynamics in a dilute polymer solution, which quantifies the effect of diffusion and partitioning of osmolyte and the related solvent quality change to the volumetric changes of the hydrogel network. By making a dominant mode assumption, we propose a new model for the swelling and compression dynamics of (spherical) hydrogels in concentrated polymer solutions. Osmolyte diffusion induces a bi-exponential response in the size of the hydrogel radius, whereas osmolyte partitioning and solvent quality effects induce mono-exponential responses. Comparison of the dominant-mode model to experiments provides reasonable values for the compressive bulk modulus of a hydrogel particle, the permeability of the hydrogel network and the diffusion constant of osmolyte molecules inside the hydrogel network. Our model shows that hydrogel-osmolyte interactions can be described in a conceptually simple manner, while still capturing the rich (de)swelling behaviors observed in experiments. We expect our approach to provide a roadmap for further research into and applications of hydrogel dynamics induced by, for example, changes in the temperature and the pH.