The top of your neck (C1, C2, C3) shares a nerve center in the brainstem with your entire head.
When those your joints get irritated from posture, desk work, sleep position, old injury, chronic tension or, a cause you may never fully pin down the surrounding joints get compressed and sensitive.
Sending pain signals that radiate from the base of the skull up and over the head, feeling exactly like a migraine. And your brain has no way to tell the pain actually started in your neck instead of your head.
This is why cervicogenic headaches get missed and misdiagnosed as migraines over and over.