Inspired by the correlation between the propulsion efficiency of a flapping foil propeller and stability of the wake behind it (which leads to the optimal Strouhal number for propulsion), we numerically simulated a heaving/pitching foil in energy harvesting regime, and investigated the relation between wake stability and the energy harvesting efficiency. The base flow is computed using a Navier–Stokes algorithm and the stability analysis is performed via the Orr–Sommerfeld equation. The wake is found to be convectively unstable and the frequency of the most unstable mode fw is determined. The case when fw ~ f coincides with maximum energy harvesting efficiency of the system (f is the frequency of foil oscillation), suggesting that flow energy extraction is closely related to efficient evolution of the wake. This occurs at a frequency of f ~ 0.15 (f is normalized by the chord length and the flow speed), under the constraint that there is significant vortex shedding from the leading edge at sufficiently large effective angles of attack. Indeed, this ‘foil–wake resonance’ is usually associated with multi-vortex shedding from the leading edge. Furthermore, detailed examination of energy extractions from the heaving and the pitching motions indicates that near the optimal performance point the average energy extraction from the pitching motion is close to zero. This suggests the feasibility of achieving high-efficient energy harvesting through a simple fully passive system we proposed earlier in which no activation is needed.