To understand how the master-slave switch works, you must first understand the roles of master and slave in a Bluetooth piconet. To understand that, you have to know about Bluetooth frequency hopping. Jennifer Bray takes a look at that topic here.

Frequency-Hopping Spread Spectrum

Bluetooth uses the Industrial Scientific and Medical (ISM) band, which is free to use in most countries. The regulators expect lots of devices to be using the same spectrum, so they have set out rules for using ISM bandwidth to make sure that devices can share the bandwidth. The rules state that you must spread the power of your transmissions across the ISM band somehow. Two main methods are used for spreading out the power: direct sequence spread spectrum (DSSS) and frequency-hopping spread spectrum.

Direct sequence spread spectrum smears a transmission across a wide range of frequencies at low power. Frequency-hopping spread spectrum uses a small bandwidth but changes (or hops) frequency after each packet.

Bluetooth uses frequency-hopping spread spectrum. There are 79 channels of
1MHz each; after each transmit or receive, devices hop to a new channel. Figure
1 shows a recording from a Tektonix WCA380 spectrum analyzer. This shows
how many Bluetooth piconets can share the ISM band. Occasionally, two piconets
may collide on the same channel, but they will just hop off to new frequencies
and retransmit any data that was lost.