Say N = p^a then number of divisors are 1,p^1,p^2,p^3,p^4…p^a so they are a+1 in numbers.

d(p^a) = a+1

Example - 2^8 = 1, 2^1 , 2^2 , 2^3 ,… 2^8.

d(2^8) = (8+1)

now, take a bit more complex one. Let’s say you have N = (p^a)*(q^b).

1 p p2 … pa

q pq p2q … paq

q2 pq2 p2q2 … paq2

… … … … …

qb pqb p2qb … paqb

so in total they form a matrix of (a+1) rows and (b+1) columns. Hence N has (a+1)*(b+1) number of divisors. We can expand this logic to any number.

Instead there can be a more formal proof also, since N = p^a * q^b * r*c … then any combination of p raised to power lesser than a will be a divisors of N, similarly for other prime factors too. So applying the basic multiplication rule of product in combinatorics we can get the number of divisors of N will be (a+1)*(b+1)*(c+1)…

Note - Number of Proper divisors will be (a+1)*(b+1)*(c+1)… -1 as proper divisors doesn’t include the number itself.

Hope this helps !