There's three mighty countries in this part of the world. In each country, one finds magicians. They are very rare: about one in ten thousand babies is born with magic, and it doesn't matter whether their parents were kings, priests or peasants. If two magicians marry, their kids have a slightly higher odds of being born magical, but for the most part it follows no pattern.
Well, except political boundaries. You see, in Country A, the magicians have a form of telekinesis. In Country B, the magic is mind control. And in Country C, it is magical healing. What could be causing this distribution?
The magic border follows the political border closely, although there's a band of a couple tens of km on either side where both kinds of magicians may be born. One day, a small city-state declared independence from Country A, and over the next few years their average rate of magicians started dropping significantly. They later became a vassal of Country B, and more magicians were born again; but now they had mind control and not telekinesis.
The society is early medieval, so the countries do not have shared water systems or anything like that. The magicians are well-respected but they are not the ruling class, there simply aren't enough of them for that.
I have considered a magic radiation emitter located in the centres of each country, with different magic caused by different radiation, but that requires circular countries. And making it purely genetic doesn't work for the city-state example, where the shift in magic-kind took years, not generations.
I am looking for rational explanations for this phenomenon. It doesn't have to be science-based but it should be logical, based on the features of the world (not some god waving their hands making it happen).