The erosion of a solid body by a high-temperature gas stream moving with high velocity, e.g. a re-entry vehicle’s heat shield which melts or chars under the effects of air friction.
During re-entry, the spacecraft travels extremely fast, and it compresses the air ahead of it. The compression of air layers near the leading edges of the spacecraft is very quick, causing the temperature of the air to rise as high as 3000 degrees Fahrenheit, or 1649 Celsius. Because it’s in contact with the craft, it heats the shuttle’s surface.
The angle of re-entry is crucial as if the entry angle is too steep, deceleration forces (the braking effect due to atmospheric friction) will become too much, and the spacecraft could break up. Additionally, the steeper the entry angle, the higher the heat flux. This is a measure of the amount of thermal energy absorbed by the heat shield every second.
Useful videos:
What really happens during atmospheric re-entry?