Suppose if we have 5 balls 1,2,3,4,5

and 6 bins a,b,c,d,e,f

So first we select a random ball -> 5 ways (either 1 or 2 or 3 or 4 or 5) lets say we selected ball 2.

then we select a random bin to put the ball 2 in it -> 6 ways(either a or b or c or d or e or f) lets say we selected bin c

so total ways = 5*6 = 30

next we select a random ball -> 4 ways (either 1 or 3 or 4 or 5) lets say we selected ball 3.

then we select a random bin to put the ball 3 in it -> 6 ways(either a or b or c or d or e or f) repetition is allowed

so total ways = 4*6 = 24

.......

Repeat the steps for remaining balls

so total ways = (5*6)*(4*6)*(3*6)*(2*6)*(1*6) =$5! * 6^{5}$ = $n! * k^{n}$

Please correct me if wrong.