In this paper we describe a new idea which may be relevant to the formation of galaxies via the infall of baryonic matter (BM) and dark matter (DM) onto a preexisting overdensity. While BM can under certain circumstances be captured by thermal processes, DM particles fly through a static overdensity without being captured. We propose a simple model for DM capture: if during the passage through it, the mass of the overdensity increases, then slow DM particles are captured by it, further increasing its mass, while faster particles slow down, transferring part of their energy to the galaxy. We estimate the minimum initial velocity of a particle required for a passage without capture through the center of the galaxy and derive a nonlinear equation describing the rate of galaxy mass increase. An analysis carried out using the ideas of catastrophes theory shows that if the increase in the mass of baryonic matter exceeds a certain threshold value, this can lead to a very intensive capture of dark matter. We speculate that this process may be associated on the one hand with the accretion of matter during the early stages of galaxy formation and, on the other hand, also later with the merger of galaxies. For the studied process to take place, the density of intergalactic DM must exceed some threshold value. Then the rate of increase in the mass of DM can be much higher than the one of baryonic matter. The capture sharply decreases after the DM density drops below the threshold value, e.g., due to the expansion of the Universe.