So you have 4 boxes.
In the first box, you have to choose which ball you want to put in. You have 4 choices.
In the second box, you have to choose which ball you want to put in. This time, you have 3 choices because you already put one in the first box.
In the third box, you choose a ball to put in. Now you only have 2 balls left.
In the final box, you only have one ball left.
Therefore the amount of ways you can distribute these 4 balls is 4x3x2x1=24 ways.
I hope this helps :)