When an object passes through the air, it creates a series of pressure waves in front of it and behind it, similar to the bow and stern waves created by a boat. These waves travel at the speed of sound, and as the speed of the object increases, the waves are forced together, or compressed, because they cannot "get out of the way" of each other, eventually merging into a single shock wave at the speed of sound. In smooth flight, the shock wave starts at the nose of the aircraft and ends at the tail.
There is a rise in pressure at the nose, decreasing steadily to a negative pressure at the tail, followed by a sudden return to normal pressure after the object passes. This "overpressure profile" is known as an N-wave because of its shape. The "boom" is experienced when there is a sudden change in pressure, so the N-wave causes two booms, one when the initial pressure rise from the nose hits, and another when the tail passes and the pressure suddenly returns to normal. This leads to a distinctive "double boom" from supersonic aircraft.