A review of wind accretion in HMXB is presented. We focus on different regimes of quasi-spherical accretion onto a NS: supersonic (Bondi) accretion, which takes place when the captured matter cools down rapidly and falls supersonically towards the NS magnetosphere, and subsonic (settling) accretion which occurs when the plasma remains hot until it meets the magnetospheric boundary. The two regimes are separated by a limit in X-ray luminosity at about 4 10^{36} erg/s. In subsonic accretion, which works a hot quasi-spherical shell must form around the magnetosphere, and the actual accretion rate onto the NS is determined by the ability of the plasma to enter the magnetosphere due to the Rayleigh-Taylor instability. Two regimes of subsonic accretion are possible, depending on the plasma cooling mechanism (Compton or radiative) near the magnetopshere. The transition from the high-luminosity regime with Compton cooling to the low-luminosity (L_x < 3times 10^35 erg/s) regime with radiative cooling can be responsible for the onset of the off states repeatedly observed in several X-ray pulsars, such as Vela X-1, GX 301-2 and 4U 1907+09. The triggering of the transition may be due to a switch in the X-ray beam pattern in response to a change in the optical depth in the accretion column with changing luminosity. We also show that in the settling accretion theory, bright X-ray flares (10^{38}-10^{40} ergs) observed in SFXT may be produced by sporadic capture of magnetized stellar-wind plasma. At sufficiently low accretion rates, magnetic reconnection can enhance the magnetospheric plasma entry rate, resulting in copious production of X-ray photons, strong Compton cooling and ultimately in unstable accretion of the entire shell. A bright flare develops on the free-fall time scale in the shell, and the typical energy released in an SFXT bright flare corresponds to the mass of the shell.