Your idea of grouping the boys in one group is entirely sound. There are 6 ways to place that group of boys in the line, $5!=120$ ways of arranging the girls after that and $3!=6$ ways of arranging the boys within their cluster, so the answer must be $6\times5!\times3!=4320$ (which is exactly the same form as the given answer).
It is very simple because the restriction in both the cases is completely different.
In the first case all the three lights can take any color, which means repetitions are allowed, so there are no restrictions. Therefore, we can say that for every light we have $3$ choices, straight forward applying the fundamental principle of counting we have number of choices:
$3 \cdot 3 \cdot 3 = 3^3$.
But in the case of permutations of the letters of the word ASCENT, there is a restriction which one must identify very logically, i.e. repetitions can not take place. Just simply think that you cannot use a letter again (e.g. you cannot make word like AAAAAA). Therefore, first we have $6$ choices (A,C,E,N,S,T). After that since we have filled one place, one letter has been used, so now we have $5$ choices. Then we will have $4$, then $3$, then $2$, then $1$. Applying fundamental principle of counting:
$6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 6!$.
So there you go. Long said short when repetitions are allowed the permutations are : $m^n$, where $m$ is number of choices and $n$ is the number of available places. When repetitions are not allowed the permutations are $n!$.
Hope this helps. Keep lovin' MATHS!
Best Answer
Any of the $4$ people can be the first person. Then, there are $3$ remaining choices for the second person, then $2$ remaining choices for the third, and then the fourth has been decided.
Hence, there are $n!$ possible ways.