On the K-5, K-7, K-x, the quality level (or number of stars) is linked with the JPEG compression method. See a number of threads on the topic for the K-7 and K-x in this Forum.
With my K-7, I did a number of tests by changing systematically the number of Mp (14 Mp, 10 Mp, 6 Mp, 2 Mp) and for each number of Mp the number of stars from 4 stars down to 1 star. My tests were repeated systematically but I would not pretend to have performed scientific tests. After all tests, I looked at the resolutions and quality of the JPEGs.
At the end, I believe that the resolution (number of Mp) is more important than the number of stars. Hence 14 Mp is a better choice for the K-7.
For my K-7, I select as basic settings JPEG 14 Mp 2 stars. If I want more details, I select then RAW+ to have both RAW and JPEG files.
I hope that the comments will be of interest .....