  Understanding the survival of gas within subhalos under various astrophysical
processes is crucial for elucidating cosmic structure formation and evolution.
We study the resilience of gas in subhalos, focusing on the impact of tidal and
ram pressure stripping through hydrodynamic simulations. Our results uncover
significant gas stripping primarily driven by ram pressure effects, which also
profoundly influence the gas distribution within these subhalos. Notably,
despite their vulnerability to ram pressure effects, the low-mass subhalos can
play a pivotal role in influencing the observable characteristics of cosmic
structures due to their large abundance. Specifically, we explore the
application of our findings to the 21 cm forest, showing how the survival
dynamics of gas in subhalos can modulate the 21 cm optical depth, a key probe
for detecting minihalos in the pre-reionization era. (abridged) In this work,
we further investigate the contribution of subhalos to the 21 cm optical depth
with hydrodynamics simulations, particularly highlighting the trajectories and
fates of subhalos within mass ranges of \(10^{4-6} M_{\odot}h^{-1}\) in a host
halo of \(10^7 M_{\odot}h^{-1}\). Despite their susceptibility to ram pressure
stripping, the contribution of abundant low-mass subhalos to the 21-cm optical
depth is more significant than that of their massive counterparts primarily due
to their greater abundance. We find that the 21-cm optical depth can be
increased by a factor of approximately two due to the abundant low-mass
subhalos. (abridged) Our work provides critical insights into the gas dynamics
within subhalos in the early Universe, highlighting their resilience against
environmental stripping effects, and their impact on observable 21-cm signals.
