Each factor (p) of N appears a times. What I mean is that p^1, p^2, p^3,..., p^a are all factors of N, as said in the question. We also include p^0 as 1 is obviously a factor of N. This means that in total there are a+1 choices for your power of p, each of which provide a different factor of N. Now we extend this to different factors of N (p_1, p_2, p_3, p_4,..., p_n). Each of which having their own unique a and therefore we can state that the factor p_n will have a_n+1 different powers to choose from. If we wish to find all possible combinations for the factors of N, we just multiply all these different combinations together and hence we end up with our final result, (a_1 +1)(a_2 +1)...(a_n +1).
Sorry if I wasn't very clear, feel free to ask for an explanation for any parts that were poorly put.