At subsonic speeds, the air striking for example the nose cone of a plane can communicate the approach of the plane to the air ahead of it with a displacement wave that can move no faster than the local speed of sound. In this way, the incoming flow can start to split some distance ahead of the nose cone itself and get started moving out of the way before the cone gets there.
AT the speed of sound, the displacement wave cannot propagate forward and instead it piles up into a thin layer right at the point of the cone. Within that layer, pressure and density go through a discontinuous jump which is called a shock wave.
Now, note that the speed of air flowing over the surface of a plane changes at different points along the plane's profile, which means that while the flow might not be supersonic right at the tip of the nose cone, it might well be halfway along the chord length of the wing. Now note that as the plane's speed is increased, the air velocity distribution over the skin of the plane will shift around in response and this effect will cause the shock waves (which indicate where the local flow goes supersonic) to also move around in ways which are difficult to predict.