To put it as simply as possible, the speed at which a single horizontal line is made was limited, both by how fast the original vacuum tubes could respond, and then by how fast the magnetic fields in the yoke could change. That speed was about 50us, with a retrace of about 13us. Or ~63us per line. If we divide 1 second by 0.000063, we get 15,873. Basically that means a TV could draw a total of 15k lines in one second (aka the horizontal refresh). Now, we also know that a TV generates a refresh signal of 60hz (this signal is not from the AC line), so if we divide 15,873 by 60, we get ~265. This is the approximate maximum number of lines one could draw in a single screen. NTSC standards put the refresh at about 15,734 (gives some headroom for blanking and such) but most people just consider it about 15,750, which puts the total number of lines at ~262, with only 240 actually visible.
Vertical resolution is less limited because it is entirely controlled by the speed at which you can change the voltage signals for the R, G and B. Given the line is analog, you could divide that 50us up however many times you want, and provided the electronics can switch fast enough, you could theoretically have thousands of 'lines' of vertical resolution, so long as you could change the colors fast enough as they draw the horizontal line. In which case the vertical resolution can be 320, 640, or even 1024 and it wouldn't change the horizontal frequency because you're only changing how many times you can change the color while drawing that single 50us horizontal line, the time it takes to draw the line doesn't change.
As electronics improved, the number of lines capable of being drawn increased, which improved the horizontal resolution of the monitor. However this also means the beam had to move in the horizontal direction faster, which changes the time it takes to draw a single line, so if you doubled the speed, you double the resolution, but it also means that now it takes about 25us to draw a line, and 7.5us for a retrace. So if you divide 1 second by 0.0000325s, you get ~30,769 lines drawn per second. Or, 31khz.
Hopefully that all makes sense.
Edit: Realized that might not entirely answer the question regarding differences between similar 15khz resolutions.
The only important thing when calculating whether or not the signal is 15ks is how many lines are drawn in one second. You can change that value slightly in either direction but generally you would change the number of lines per field by manipulating the refresh rate. Dropping the refresh rate allows you to put more lines on the screen. For example, if you were to drop the refresh rate to ~53hz, with approximately 15,750 total lines, that lets you do draw nearly 300 lines per screen instead of the normal limit around 262, so by slightly messing with refresh you can change the total number of lines you can get per screen.