They're meant to be the stars going by. Of course, it's taking huge dramatic license, the stars are so far apart that a ship would have to be going millions of times the speed of light for the stars to move visibly like that. But it was done to create the visual impression of movement.
We see them at sublight speed as well because of stock effects elements being used, or again simply as dramatic license to create the impression of movement.
This is quite on point. I have a program called Celestia
that also allows you to see what it would look like to be moving through the galaxy at faster-than-light speeds. If you crank it up enough to thousands of times the speed of light some of the nearer stars to your position do indeed look much like what we see on TOS. It's rather cool.
Of course this is based on the assumption that warp space still somehow looks very much like normal space. The program would be more accurate if it showed Lorentz distortion as you approached the speed of light.