It looks like it's a sort of double twist cable. In row 9, you work 12 stitches then a 3/3 cable, then followed by a K3, etc., so that 'K3' after the cable seems out of place but if you look ahead to row 13 there is another cable row but this time the cable is shifted 3 stitches over compared to the one in row 9 with the extra 'K3' coming before the 3/3 cable. This repetition forms the cable as you see it in the picture.
As for the alternating between knits and purl in the non-cable part of the pattern.....the very edge stitches form seed stitch and then there's a solid 4 stitch rib before the cable part. The seed stitch border helps the scarf to lay flat, and the 4 stitch rib really sets off the center cable. If you just purled all of those stitches you would end up with a scarf that will curl in a lot on the edges, and cable that doesn't really stand out.