And so it comes down to sub-shells. Why do they exist? What dictates their shape? And what else differs about them? As you can see in the image, each electron’s situation within an atom is a culmination of numerous factors, and explains why only certain electrons within the same energy level interact with electrons of other elements, whereas others do not.
Look at this chart depicting the various sub-shell shapes of the magnetic quantum numbers for s, p, d and f. What you are seeing are 3-dimensional regions of space representing the probable locations in which each electron for that atom can reside. Each sphere, teardrop, donut, or lobe is a region in which at any point in time you can locate one or two electrons. And so as an atom possesses more and more electrons, more regions need to be demarcated/allocated for each electron.
One mustn’t forget about all the other electrons and their residential 3D spaces! So the chart shows these spaces separated by their n and l quantum numbers. The upper right image shows how merely 3 of the sub-shells, 1s, 2s, and 2p, occupy/overlap within the same atomic space. It's pretty complex already, isn't it?
Next, we’ll see how the sub-shell of one element interacts with a sub-shell of another element!