Each gear set (1 - 5)  has an input and an output gear.  One or the other is permanently attached to either the output shaft or the input shaft.  Let's consider 3rd or 4th gear - their gears freewheel on the input shaft, and are coupled to gears that are permanently connected to the output shaft.  The output shaft is always connected to the wheels through the differential, and it is spinning 3rd and 4th output gears at "road speed".  When the clutch is pushed in, the input shaft is decoupled from the engine, so now if we can bring the input shaft up to the same speed as either the 3rd or 4th input gear is spinning, we can engage the gear easily, without grinding.  Third and 4th output gears are both spinning at output shaft speed, but 3rd and 4th INPUT gears are spinning at DIFFERENT speeds, because the gear ratios are different - and this is why we need to bring the input shaft's speed up or down to match the gear speeds.  Here's how that's done:

The side of the gear that is adjacent to the synchro has small pointed teeth that point toward the hub and sleeve.  The brass synchro rings have identical teeth oriented in the same direction.  The synchro rings interlock with the hub, although the rings are allowed to float – that is, they are allowed a small amount of rotational movement, as well as a slight amount of fore and aft movement.  Normally, they float away from the beveled gear surface, with just a miniscule amount of contact.  The slotted sliding sleeve has similar pointed teeth; actuated by the shift fork, it slides back and forth on the slotted hub.  Very light friction from the spinning gear causes the brass ring to rotate slightly in the direction of spin (differential spin, that is: the gear’s rotational speed relative to the rotational speed of the shaft).  As the sleeve’s pointed teeth begin to mesh with the slightly offset pointed teeth of the brass ring, the angles between the two sets of teeth thrust the brass ring toward the gear, which forces the two conical surfaces (between ring and gear) into contact.  This “grabs” the gear, which forces the gear’s rotational speed to match that of the shaft.  As this progresses (very rapidly), the angled faces on the sleeve’s pointed teeth acting on the angled faces of the ring's pointed teeth, cause the ring's teeth to rotate into alignment with the teeth on the sleeve.  Matching the gear and shaft speeds brings the gear's teeth into alignment  with those on the sleeve, and the sleeve's teeth then mesh with the teeth on the gear.  At this point, the hub is locked to the gear, and the gear change has been completed.  And yes, folks, that single ring of itty bitty teeth is transferring all the power from the gear to the shaft (or the shaft to the gear, depending on your point of view).

In the case of first and second gears, the freewheeling gears are on the output shaft, and the fixed gears are actually machined into the input shaft.  In this case, the output gear, input gear and input shaft all have to be brought up or down in speed to match the speed of the output shaft.  There's a lot more mass being brought up to speed here, and the speed differentials are generally greater because of the lower gear ratios, so you can see why the second gear synchro tends to be the one to fail.  First gear is the most vulnerable because of its low ratio and high mass (the lower the gear ratio, the bigger one of the two gears is), but it's seldom used since it's only used on downshifts, and low gear downshifts are fairly rare.  The second gear synchro rings have to match every up-shift from first and every downshift from third ... if you slam shift a lot, you're asking an awful lot of the second gear synchro rings.