Number 3 appears to be the top cap assembly which goes on the installed fork steer tube after the top bearing is placed into the top bearing race or cup. It covers and helps seal the top headset bearings. The next thing that slides on the installed steer tube after the number 3, is a split ring, centering sleeve which will slide down and into #3. Combined with the actual topcap through which the preload bolt passes through, those parts make up the "topcap assembly." It's a bit unclear in the photo, but 1 and 2 appear to be spacers. These go on top of the centering sleeve, if necessary, and just prior to the stem so that there is about a 3-5mm space from the top of the stem down to the top of the steer tube. This gap is necessary so the preload bolt can tighten the system up appropriately when it is threaded down the star fangled nut installed within the steer tube. Alternative to the star fangled nut and necessary if the steer tube is carbon fiber, is a compression nut that serves the purpose of the star fangled nut to receive the preload bolt to bring everything together. In addition, the compression bolt unit serves as a solid backstop for the carbon steer tube against the force of the stem's clamping force when it's fixing bolts are done up.
You noted having a spacer on top of the stem. This serves as way to get the necessary 3-5mm gap the topcap-bolt requires to preload the bearings. As such (as well as good aesthetic's), the spacer above the stem is typically thinner--no more than 2.5mm looks best to me but some put a ridiculous amount of spacer height above the stem. Number 1 looks to be appropriately sized spacer for above the stem just prior to the topcap and preload bolt. This upper spacer position is unnecessary if, when the stem and spacers (if any) below it have sufficient height to get the necessary gap discussed above.
Incidentally, if you've replaced the fork that was originally mounted with a different fork that has a different length of steer tube, you won't require the same amount of spacers as the first, now uninstalled, fork. Obviously, if you're reinstalling the same fork unchanged or a different one that has identical dimensions of the steer tube as the first, the spacer set up (given the same spacers are used) should work the same.