The water vapor, density and temperature were just right, and there just happened to be a camera in the vicinity to capture the moment. The F-18 is in transonic flight, with normal shock waves emanating from behind the canopy and across the wings and fuselage. The condition will last for only an instant. Once supersonic flow exists completely around the aircraft, sharp-angled sonic cones replace the normal shock waves.
The odds against capturing an image like this are staggering.