Efficiently selecting biomass precursors to prepare porous carbon with rich pore structure and heteroatom doping, and clearly distinguishing the storage behavior of Li+ and Na+ in porous carbon are still the key issues for the development and utilization of biomass-based carbon materials. In this work, four kinds of samara with a hollow structure are used as carbon sources to prepare an N, O and S co-doped hierarchical porous carbon. As the anode for Li/Na-ion batteries, the reversible specific capacity of N, O and S co-doped hierarchical porous carbon (HPC-UP-6) is 1072.3 mAh·g−1 (0.0744 A·g−1) and 333.2 mAh·g−1 (0.1 A·g−1), respectively. The ultra-high specific capacity reveals the rationality of preferentially selecting plant fruits with hollow structures as precursors. In addition, further comparative studies show that the contribution rate of surface-induced capacitance in sodium-ion batteries is more than 10% higher than that in lithium-ion batteries, indicating that Na+ tends to be stored on the surface of porous carbon. This principle of selecting biomass precursors and the new understanding of the storage mechanism of Li+/Na+ in biomass-based porous carbon can guide the design and preparation of new carbon materials with high capacity and high-rate performance.