The escape velocity of a planet is related to its surface gravity. The higher the surface gravity, the higher the escape velocity. In the case of Mercury, due to its small size, the escape velocity is lower compared to larger planets like Earth. This allows gas particles in the atmosphere to reach the escape velocity more easily and escape into space.
Moreover, Mercury is exposed to intense solar radiation and the solar wind because of its proximity to the Sun. The constant bombardment of energetic particles and radiation from the Sun can contribute to the gradual loss of atmospheric gas particles through processes such as sputtering and evaporation.
Additionally, Mercury lacks a significant magnetic field, which would help protect its atmosphere from being stripped away by the solar wind. As a result, the solar wind can directly interact with the tenuous atmosphere of Mercury and cause further erosion over time.