Why do buffers need to be composed of equal amounts of the acid and salt?
They don't need to be comprised of equal amounts.  However, when you are near the 50:50 point, the buffer is "unbiased" (a contrived term), and it can equally accommodate assaults to its pH going in either direction.

If, as in your first example, you're sitting at equal concentrations of sodium acetate and acetic acid, dropping in a 1 mole of either NaOH or HCl won't overwhelm the buffer capacity (pH will change, but not as quickly as it would when you exceed capacity).

Conversely, in your second example, if you add 4 moles of NaOH you'll still be buffered, (acetate will rise to 7 moles, acid fall to 5), but if you add 4 moles of HCl, you'll protonate all the acetate back to acetic acid and the buffering effect will collapse.

So while they don't need to be at the 50:50 point, it's generally a good idea to stay in that order of magnitude (which is why recommended buffering ranges are roughly 1 pH unit); 10:90 is iffy (used appropriately, it works fine), but 1:99 is nearly pointless.  The pKa is the theoretical pH when at a 50:50 mix, so different chemicals are used for different pH buffers (Good's buffers shown below).