This is a classic example of superposition as applied to linear systems - if you consider your circuit as a function mapping excitations (the voltages and currents of independent voltage and current sources, respectively) to node voltages/currents (i.e. the solved circuit), it's linear if the circuit consists only of linear elements (linear dependent sources, R/L/C).
As a result, you can compute the superposition of two different sets of excitations - one representing the excitations of your original circuit (i.e. the 72 V source in your example, but in general including all independent voltage and independent current sources), and one representing the external excitation connected to the port.
In order to compute the response of the circuit to the external excitation, you must first null all of the internal sources in your circuit to leave only the external excitation.
The primary insight here is that an independent voltage source becomes a zero-volt voltage source. A zero-volt source is nothing more than a short between the two nodes - the two nodes necessarily have the same voltage because the voltage between them is zero, and there's no restriction or mathematical statement regarding the current flowing in that branch.
Likewise, you can null an independent current source by setting its current to zero. A branch with no current across it is simply a branch that doesn't exist and was open-circuited, and there's no restriction on the voltage between the two nodes.
Note that dependent current sources stay the same - they have linear effects in a linear circuit, but they themselves are not excitations.