Hypothesis: the Source of Magic is an AI with the goal to work in the way (magical) people really believe it should work. Or maybe, to make the world work in the way (magical) people really believe it should work. The strength of belief appears to be important, so a strong belief can override weak ones. On the other hand, when something is already “generally known” to work in a certain way, this is a very strong belief.
Examples:
Broomsticks work by Aristotelian physics [because it was what people believed when the broomsticks were invented, and now people just know (=believe really strongly) that’s how broomsticks should behave]
Spell names and laws [inventors create spells by finding sounds they believe should work. When spells become known, they stabilize in that form]
Potions Law
Ritual magic [people really believe in sacrifices and not getting something for nothing]
Ghosts (and afterlife?) [effects of religious beliefs]
Harry’s partial transfiguration [very strong belief, finds a loophole to not be in conflict with existing strong beliefs of other people]
Magic doesn’t make sense to Harry because it now reflects lots of ad hoc rules and beliefs accumulated in centuries. Wizards and witches believe them from childhood. [No wonder they are half-insane.]
Interestingly, this hypothesis implies that Dumbledore’s narrative causality may actually work—people do believe in stories.
--Chinese Tale