If you were to multiply out the expressions and combine like terms, you'd arrive at the number of summands.
The number of summands in the first is the number of triples $(a,b,c)$, with $0 \leq a,b,c \in \mathbb{Z} \leq 7$ and $a+b+c=7$. (Do you see why?)
The number of summands in the second is the number of quadruples $(a,b,c,d)$, with $0 \leq a,b,c,d \in \mathbb{Z} \leq 9$ and $a+b+c+d=9$. (Do you see why?)
EDIT: As an example, let's do $(a+b+c)^3$.
Multiplied out (I used Wolfram Alpha), it's:
$$a^3 + b^3 + c^3 + 3a^2b + 3a^2c + 3b^2c + 3b^2a + 3c^2a + 3c^2b + 6abc.$$
Now, let's look at the exponents of $a,b,c$ on each summand, in order:
$$(3,0,0), (0,3,0), (0,0,3), (2,1,0), (2,0,1), (0,2,1), (1,2,0), (1,0,2), (0,1,2), (1,1,1).$$
I listed all of the triples $(a,b,c)$ for which $0 \leq a,b,c \in \mathbb{Z} \leq 3$ and $a+b+c=3$.
Hopefully this makes it a bit clearer.