Answer:
As far as i know, it's when the nerves at the top of your mouth (or the roof) sense the cold.
Step-by-step explanation:
This is different to you sensing cold in your fingers or other parts of your body as it is closer to the roof of your mouth making your nerve feel much more. Since those nerves are exposed to that cold so much more than most other parts (and are closer to the brain, which i'm not sure if it affects anything) you feel a freeze which most people think they feel at their brain, hence the name 'Brain freeze'
Hope it helps!