Adsorption and desorption of polymers in the presence of flowing fluids lies at the heart of many technological applications such as thin film deposition via layer-by-layer fabrication, development of surface coatings and responsive interfaces, stabilization of colloidal suspensions, and rheology modifiers. Adsorption under flow also constitutes a key step in many physiological mechanisms, e.g., formation of a platelet plug during hemostasis. Moreover, flow induced adsorption/desorption offers a rich source of problems from the point of view of fundamental polymer physics. However, despite its importance little is understood about the behavior of adsorbed polymers under flow, in contrast to the well-developed field of adsorption from a quiescent solution. Some experimental observations regarding the effect of flow on adsorption/desorption exist in the literature, but they are mutually conflicting and the underlying physics involved is yet to be explained. In this work, we provide new insight into the mechanism of adsorption/desorption under shear flow near a single planar wall using kinetic theory and Brownian dynamics (BD) simulations. We show that in the presence of shear flow accounting for hydrodynamic interactions (HI) between the polymer molecules and the wall is crucial to observe the experimentally obtained trends of the amount of adsorbed polymer with respect to shear rate and molecular weight. The amount adsorbed is governed by a balance between HI-induced repulsion and polymer-wall attraction. At a fixed molecular weight increasing shear rate increases HI, causing a reduction in the amount adsorbed. Moreover, if the shear rate is fixed the amount adsorbed decreases with an increase in molecular weight. These trends are in qualitative agreement with prior experimental observations of Lee and Fuller [J. Colloid Interface Sci. 103, 569 (1985)]. In the case of desorption, the trend for the amount adsorbed with respect to molecular weight depends on the polymer-wall interaction energy. We show that when adsorption is weak, desorption increases with an increase in molecular weight, but for strong adsorption the trend is reversed. We provide an explanation for this reversal in terms of the change in polymer conformations with increase in the interaction energy, thereby resolving the apparently conflicting experimental observations of Lee and Fuller and Soga and Granick [Langmuir 14, 4266 (1998)].