When you are shooting something that is moving very fast you increase your shutter speed. For concerts 1/320 of a second is usually fast enough to freeze the performer’s movements.
When you are doing light painting or light trails what you are shooting isn’t moving so you can use a slow shutter speed to capture the vivid colors and use various movements to create a variety of shapes and effects.
However freezing two things at once and getting a usable picture is very hard.With this photo what froze the movement of the performer and captured the light trails in the background was the flash and not the shutter.
This was taken at 4000 ISO,f29 at 1/6 of a second with the flash power at 1/64 while pointing the flash straight ahead.