The oscillating hydrofoil, a device used for collecting environmentally friendly tidal energy, is the focus of the study. The flexibility of the hydrofoil's trailing edge can impact its surface pressure distribution, lift, and moment characteristics. To improve the energy harvesting performance of oscillating hydrofoils, it is important to conduct thorough research on their energy harvesting mechanism. Therefore, numerical analysis is employed to develop a numerical model of the fully passive oscillating hydrofoil with the flexible trailing edge. The dynamic development behavior of surface vortices on hydrofoils is analyzed, demonstrating that the fluid–structure interaction between the hydrofoil and the surrounding fluid alters the hydrofoil's motion. The vortex patterns and pressure distribution on the hydrofoil surface are also affected, ultimately influencing the energy harvesting performance. By optimizing the flexibility coefficient of the fully passive oscillating hydrofoil with a flexible trailing edge, the energy harvesting performance of the oscillating hydrofoil is improved. When the maximum chord offset δm= 0.1c and the flexibility coefficient n= 2, the energy harvesting efficiency is 31.37%, and the average power coefficient is 1.17. Therefore, increasing the tail flexibility can be considered to enhance energy harvesting performance when designing the fully passive oscillating hydrofoil. The research provides a comprehensive analysis of energy harvesting performance, addressing the dynamic problem of the fully passive oscillating hydrofoils with flexible trailing edges. The findings of this study may provide guidance for the design and optimization of tidal energy harvesting devices with similar structures.