It depends on the frequency. The brain is mostly water, but there are clear differences in the dielectric constant of air, the skull (bone) and the sweet delicious gray matter inside the cavity. By tuning the frequency of the waves, you can set up resonances in the cavity.
For a related effect, see https://www.youtube.com/watch?v=wCrtk-pyP0I