Middle English midwif combines mid, with, and wif, woman. Familiar-looking pieces preserve meanings that are easy to overlook today.
The preposition mid was inherited from Old English. The cited complete compound is Middle English.
Sources
- Merriam-Webster: midwife
Noun Word History explicitly gives mid with and wif woman, and identifies the Middle English compound.
- Online Etymology Dictionary: woman
Also built on *wif* "woman": woman, from Old English wifman (wif + man)
- Online Etymology Dictionary · midwife
Meanings of the older forms on the word path.