AVR Timer1 OCR1A controls TIMER1_COMPB_vect interrupt!
By setting WGM12, you set the time to CTC mode. In this mode the timer will restart when it reaches that value set to OCR1A. So the lower the value, the faster it restarts, so the higher the frequency.

The OCR1B value only changes where in this cycle the interrupt occurs. It will however still only be called once per timer1 overflow.