Pressure pulse effects in intake and exhaust tracts....the short version....
In simplified terms, both the intake and exhaust tubing have shock waves that travel back and forth between the cylinder and the first junction in the tubing. The shock wave travels at the speed of sound and is caused by the valve opening on a cylinder whose pressure is different than the surrounding air.
The speed of sound is heavily influenced by the temperature of the gas it is traveling in. On the intake side, the speed of sound is roughly 1,150 feet per second (fps). Standard temperature and pressure (STP) air has a speed of sound of 1114 fps (but the intake air is usually warmer by 50 degrees or so...so 1150 fps is a good compromise).
The traveling shock wave has an effect on the pressure in the tube in which it is traveling, and causes the pressure in the tube to rise and fall in a wavelike fashion. Without getting into details, the shock wave must travel out and back twice for a full pressure cycle in the tube (four lengths of the tube total). Under certain conditions, the pressure fluctuation is strong enough to actually reverse the flow in the tube temporarily.
Traveling from a smaller to larger tube diameter has very little effect on the shock wave progression and pressure effect. However, traveling from a larger diameter to a smaller diameter passage...and having a sharp lip at the transition...causes a portion of the shock wave to reflect off the lip. This reflected shock wave acts like a dam to help reduce any reversed flow. Typically, the lip ineeded is ~1/8” (i.e. the intake manifold tube ID is ¼” smaller than the intake port ID)
Due to the incredibly nice, smooth, intake ports and manifold runners on the old Datsun L series engines, reversion could be a significant problem....even so strong as to force the fuel air mixture out of the mouth of the carbs....making a nice little fog of fuel-air you could actually see. Since they were carburated engines, the reversed flow could also cause extra fuel to be mix into the air stream, seriously screwing up the fuel mixture calibration. The offset step between the manifold and head did wonders for these engines.
On the exhaust side we are dealing with much higher pressures and temperatures. The shock wave velocity can reach nearly 2000 fps. “Tuned” headers use the shock wave induced pressure fluctuation to create a low pressure condition just as the valve overlap period occurs. During that time the exhaust tubing pressure gets connected to the intake manifold though the cylinder. So, when the timing is right, you getthe exhaust sucking on the cylinder, which inturn sucks on the intake manifold.
On the exhaust side, because of the increased energy in the heated gasses, pressure fluctuations of as much as +/- 6 psi can occur. Thus, you get can get the equivalent of 6 psi of “boost” on the intake side...i.e. the intake side has -6 psi of suction helping to start the intake flow.
On the exhaust side, you want to help the suction (negative pressure) and block the reversion (positive pressure) going back into the cylinder during the overlap period...so you leave the exhaust port ¼” smaller in diameter than the header pipe ID.
Now, if you’ve followed this...you’ve realized that the timing of that whole suction effect only works for certain RPMs, and is tied directly to the length of the header primary tubes. Longer header primary tubes cause the timing to be correct at lower RPMs.