We investigate the forces and unsteady flow structures associated with harmonic oscillations of an airfoil in the streamwise (surging) and transverse (plunging) directions in two-dimensional simulations at low Reynolds number. For the surging case, we show that there are specific frequencies where the wake instability synchronizes with the unsteady motion of the airfoil, leading to significant changes in the mean forces. Resonant behaviour of the time-averaged forces is observed near the vortex shedding frequency and its subharmonic; the behaviour is reminiscent of the dynamics of the generic nonlinear oscillator known as the Arnol'd tongue or the resonance horn. Below the wake instability frequency, there are two regimes where the fluctuating forces are amplified and attenuated, respectively. A detailed study of the flow structures associated with leading-edge vortex (LEV) growth and detachment are used to relate this behaviour with the LEV acting either in phase with the quasi-steady component of the forces for the amplification case, or out of phase for the attenuation case. Comparisons with wind tunnel measurements show that phenomenologically similar dynamics occur at higher Reynolds number. Finally, we show that qualitatively similar phenomena occur during both surging and plunging.