Edward, this is something you will almost have to memorize. Let's look at how it works.
We can either have the difference or the sum of a and b, each to the same odd power, ie a3 - b3, or a9 + b9.
If you have a difference, then your first factor will be (a-b). If you have a sum, the first factor will be (a+b).
The second factor works like this: You start with a to the power of your power-1, so if you had a7, you'd start with a6 and work down to a power of 0 (a0 = 1, right?).
The b's go the opposite way. You start with b0, which also equals 1, and go up to b to the power of your power-1.
If you have a difference, then everything in the second part will be positive. If you have a sum, then we start with positive and alternate signs. The reason for this is that all but one of our pairs must cancel out.
Let's look at your example. x5 + y5 = (x+y)(x4y0 - x3y1 + x2y2 - x1y3 + x0y4).
Since anything to the 0 power equals 1 and anything to the first power is itself, then we have
(x+y)(x4 - x3y + x2y2 - xy3 + y4).
If we multiply that out, we get x5 + x4y - x4y - x3y2 + x3y2 + x2y3 - x2y3 - xy4 + xy4 + y5.
Everything in the middle cancels out and we end up with x5 + y5.
For fun, let's try x11 - y11.
Then, we'd have (x-y)(x10 + x9y + x8y2 + x7y3 +x6y4 + x5y5 + x4y6 + x3y7 + x2y8 + xy9 + y10)
I hope this makes sense!