When you throw a ball straight up in the air, it will fall back. The harder you throw it the higher it will go before it falls back. There is, however, a speed at which you can throw that ball and it will never come back. It will "escape" the Earth's gravity, asymptotically slowing to zero.
The escape velocity at the surface of a neutron star is very close to the speed of light. Light can still escape from the surface, but it is strongly redshifted by the intense gravity.
If a neutron star happens to closely orbit another star that has entered a red giant phase, then matter from the red giant may fall onto the surface of the neutron star. This can have two effects. First, the angular momentum of the infalling matter will cause the neutron star to spin more rapidly. Some have been seen spinning at nearly a thousand revolutions per second.
Think about that for just a minute. This is an object that weighs more than our Sun, compressed into a sphere less than ten miles in diameter, and spinning at a kilohertz. The sheer amount of kinetic energy is -- mind boggling.
The second effect of the infalling matter is to raise the mass of the neutron star, and therefore it's escape velocity. As this process continues, the escape velocity gets closer and closer to the speed of light.
The infalling matter is, of course, getting accelerated close to the escape velocity. As if falls inward it is compressed, and frictional forces heat it. Hot compressed hydrogen fuses before it reaches the surface, emitting even more energy, much of which is channeled by the spinning magnetic field into vast beams that sweep through the heavens.
At last the crisis is reached. The neutrons in the star have been desperately trying to arrange themselves into higher and higher energy shells to accomodate the infalling matter. But at last there are no more energy shells available. The next highest shell would have the neutrons in that shell exceeding the speed of light.
And so gravity wins. The neutron star begins to collapse under it's own gargantuan gravity. Nothing we know of can stop that collapse, and it probably doesn't matter, because as the neutron star collapses it passes through the radius where the escape velocity equals the speed of light.
There is no amount of energy that can cause an object to come back out of that radius. Anything that falls in must keep falling in forever. That includes light, and all forms of radiation.
The neutron star has become a black hole.

Source: x.com/unclebobmartin/status/1827703431038939143