This is a powerful magic spell, requiring quite a bit of skill in magic to cast. It's primarily a necromantic spell, but the ability to actually prepare and create the "brain pie" requires quite a lot of skill in doing things like keeping something alive with grievous injuries and enchantment or domination magic to successful finish the casting. For both these reasons, Lichs are among the most common spellcasters to attempt this spell; since messing up typically doesn't hurt them very much compared to dying if it was a normal, human spellcaster.
This spell requires the spell-caster to create and shape a pie, and then using their magic, dissect a cut of their brain out of their head to be baked. The pie is filled with gray matter, blood, and a slurry of memories, thoughts, opinions, and knowledge. It is then baked in an oven that requires a magic flame. Finally, when it is ready, it must be consumed.
The target of the spell is always disgusted by the pie, even if they don't know what is in it. Both the smell and then the taste and texture after the first bite is totally revolting. You could just feed the pie to a zombie or ghoul or something, but that would be less optimal for the spell. As such, forcing a living person to eat the pie usually requires force or domination magic.
Upon baking the pie, the spell caster loses -1d6 points of Intelligence permanently. There is no protection for going under zero or crippling yourself automatically with a casting of this spell, hence the need for additional magic protections or methods to retain your intelligence even after cutting out part of your brain.
Once the pie is eaten, the person who ate the pie gains +1d4 points of Intelligence. Then, they feel the spell caster's brain matter grow in their skull. This process is not painful, but it is very unnerving and unwanted. This has two effects. Firstly, the pie-eater will have intrusive thoughts once every 1d4 days from the spell caster; usually evil or villainous thoughts, since most people who cast this spell are going to be evil. Secondly, the person becomes a spell battery for the spellcaster. Any prepared spells the spell-caster learns are remotely stored within those who have digested their brain pie. This means they know what spell is prepared, but cannot cast it themselves, or do anything about stopping it.
For each person who has eaten brain pie, the spell caster may store an extra spell. This is an addition to all their normal spells they can prepare per day. Secondly, the spellcaster does not lose any intelligence in regards to spell casting no matter how sliced up their brain becomes from the effects of this spell. The spell caster loses a part of their brain, knowledge, and intelligence with each pie, but their magic retains the same level of power, and they gain more spell slots. You can feed multiple pies to one person, though most pay the same intelligence cost each time.
If and when a person who ate the brain pie dies, or has an advanced special lobotomy to remove the unwanted brain-growth; the spell effect on them ends and the caster loses that spell slot. They do not regain their gray matter.
Most spellcasters who cast this spell will have a prison or will use it on immortal beings. It may be possible through various means to trick people into eating and holding on to the brain pie for a long time- enchantment and illusion spells will do wonders for this. Subtle clues (like the unwanted thoughts, strange "feeling" of magic spells inside them that they didn't put their, etc.) will still hint that their brain was hijacked by this spell, but for those with their memories wiped they could be acting as long term spell batteries for those who use this magic.