This program is for count number of partitions of a set with n elements into k subsets I am confusing here `return k*countP(n-1, k) + countP(n-1, k-1);`

can some one explain what is happening here?
why we are multiplying with k?

NOTE->I know this is not the best way to calculate number of partitions that would be DP

```
// A C++ program to count number of partitions
// of a set with n elements into k subsets
#include<iostream>
using namespace std;
// Returns count of different partitions of n
// elements in k subsets
int countP(int n, int k)
{
// Base cases
if (n == 0 || k == 0 || k > n)
return 0;
if (k == 1 || k == n)
return 1;
// S(n+1, k) = k*S(n, k) + S(n, k-1)
return k*countP(n-1, k) + countP(n-1, k-1);
}
// Driver program
int main()
{
cout << countP(3, 2);
return 0;
}
```