The essence of the reason, why this approach works for graphs with a different number of nodes is the locality and node order permutation invariance.
The typical form of the layer-wise signal propagation rule is:
$$
H^{(l+1)} = f(H^{(l)}, A) = \sigma (A H^{(l)} W^{(l)})
$$
Here $H^{(k)}$ are the activations of the $k$-th later, $W^{(k)}$ is the weight matrix, $A$ is the adjacency matrix and $\sigma$ is the activation function.
Activation function $\sigma$ and $W^{(k)}$ is the same on any graph, and the difference is only in the choice of adjacency matrix $A$.
Aggregation of the information from the neighborhood is done in permutation-invariant way, and the only way to do this is to assign the same weight for every member in neightboorhood, and (probably) some other weight to the node itself.
For Graph Convolutional Neural Networks (GCNN's) this works as follows:
$$
h_{v_i}^{(l+1)} = \sigma (\sum_{j \in N(i)} \frac{1}{c_{ij}} h_{v_j}^{(l)} W^{(l)})
$$
Regardless of whether the node is isolated or has many neighbors procedure is unchanged.
Older approaches, the spectral for example, had to calculate the Graph Laplacian and perform its eigendecomposition. They did not generalize to other graphs.