We have evidence of trepanning (drilling holes in the skull) going back to the flint tools time period. We still use this today to release pressure after a bleed in the skull.
It was a lot more brutal and had a much lower success rate back then. But the fact that we find so many skulls with evidence of trepanning means that prehistoric humans must have considered the low success rate worth the risk. What's interesting is there's no way they actually knew what trepanning could help with, since it's to do with intracranial pressure. So in the same way the medieval cure for everything was bleeding, whether or not the disease had anything to do with blood, trepanning seems to have been the proverbial hammer for which everything looks like a nail.
Head injuries would have been common, bleeding on the brain was probably easily recognisible in warriors for which it would help. How they discovered that it helps.. nice
i can't imagine that increased intracranial pressure feels good. maybe one guy was like 'my head feels like it's gonna explode', and some other guy was like, 'i've got an idea'. or maybe someone happened to get just the right kind of second head injury shortly after their first head injury that somehow made them get better. it's a lot of unrecorded things happening back then. if only they had invented writing and wrote it down.
I mean, even on a mild headache you feel like the inside of your head is swallen, even if you don't know what a brain is. Imagine a traumatic fall, fever and constant pain. After the tenth time you see that happening you grab a stone and try nad fix it.