This is all decided by the KSHSAA. They basically divide the state into four geographic regions and whatever region a town falls in is where they go. This is a little simplified but basically correct. The state also makes no bones about the fact they want to get "the best kids from the four regions of the state"-not necesarily the best kids in the state.