The migraine aura is rather well understood, it is the result of cortical spreading depression, a phenomenon where a "wave" of brain hyperactivity spreads in as a ring on the surface of the cortex, leaving a hypo-active zone in the middle.

It is possible to trigger the phenomenon by hurting the brain (e.g. sprinkle acid on a rat's brain, WP has a neat video: https://en.wikipedia.org/wiki/Cortical_spreading_depression) so we suppose that it is a defense mechanism in humans too, but we're not sure what causes them.

I've done research on migraine, 10 years ago, but I haven't kept up with the field. There are hypotheses, but no known cause for the headaches and associated symptoms.