Summarize this article:

There is a white bracket and a smaller plastic piece that fits inside of it on which the Mac key rests; this assembly can easily pop out and fall apart when removing the Mac's key. To put it back in place, simply re-insert the smaller piece into the bracket, then place the carriage back in the key slot lengthwise with the small square hole on the right side of the key slot. Do this at a 45-degree angle. The goal here is to get the white hooks at the bottom of the slot to catch on the underside of the key. If the hooks don't catch, remove the key and try again. The key should be almost flush with the other keys. This will clip the key into place. You should hear a couple of light snapping noises; this signifies that the key is back in place. Press down on the key to ensure that it springs back up. If it does, your key should work normally. If the key doesn't spring back up, that means that the hooks didn't properly catch. The key failing to spring up can also be symptomatic of a faulty key assembly.
Reassemble and replace the key carriage if necessary. Place the bottom of the key in the slot. Gently lower the key into place. Press down on the top of the key. Press all the way around the key. Test the key.