Befriend

What is the etymology of ‘befriend’?

I split the word into ‘be’ and ‘friend’ and look them up. I know what ‘friend’ is.

‘be-’ is:

From m-w.com:

Middle English, from Old English bi-, be-; akin to Old English bI by, near — more at BY … 5 : make : cause to be : treat as <belittle> <befool> <befriend>

That’s all well and good. But how do you get to ‘behead’? Oh, the wonders of modern English.