This work studies the aerodynamics of two tandem foils flapping near a boundary layer (BL). The interaction between the tandem foils and the BL is modulated by the foil-to-wall distance rescaled by the foil chord length (
$H_0/c$) and the Reynolds number based on free stream velocity (
${\textit{Re}}=U_{\infty }c/\nu$). Taking the single foil under the same configuration as the reference, difference reductions are observed in forces between either of the tandem foils and the single foil, due to the weakened coupling between tandem foils in the presence of the BL. For a similar reason, it is revealed that, as
${\textit{Re}}$ increases, the force evolutions of the hind foil increasingly resemble those of the fore foil, being a second difference reduction. When examining the system’s evolution, we find that, in some cases, the evolution period of the force and the wake flow doubles that of the flapping cycle. From the Lagrangian coherent structures, it is indicated that this period doubling occurs because, in these cases, only one of two trailing edge vortices, shed in two successive cycles, is convected downstream, while the other is trapped and eventually dissipated in the BL. This interpretation has also been well confirmed by the frequency response from the modal analysis. In the cases with period doubling, the effect of the BL is relatively weak, corresponding to a coupling-dominated mode of interaction. Additionally, BL-dominated mode (low
${\textit{Re}}$ and/or low
$H_0/c$) and foil-dominated mode (high
${\textit{Re}}$ and/or high
$H_0/c$) are also identified, where the period doubling is not present anymore, respectively because of the strong BL effect and its absence. Finally, a bifurcation analysis is conducted to explore the dynamical nature of the system’s evolution. As
$H_0/c$ increases, the system first undergoes a flip bifurcation, leading to the period doubling due to the decaying BL effect; and then an inverse period doubling bifurcation occurs, corresponding to a transition from coupling-dominated to foil-dominated interaction mode. If taking
${\textit{Re}}$ as the bifurcation parameter, a flip bifurcation is also first observed, sharing the same physical picture as the flip bifurcation identified when increasing
$H_0/c$. Further increasing
${\textit{Re}}$, the system will undergo a Neimark–Sacker bifurcation due to the nonlinear nature of the convective flow, and the evolution of the system transitions from period doubling to quasi-periodic state.