What causes optic migrains?

Two conditions. can be referred to as Optic or Ophthalmic migraine. The first is migraine with visual aura (zig zag lines, flashing lights, shimmering distortions of vision) this involves both eyes & is generated in the part of the brain that processes vision. It is common and relatively benign and self limiting. Transitory loss of vision in one eye is another matter which obviates an urgent visit with an eye MD.
Unknown. We know that a change in the blood circulation to the occipital lobe causes the pattern of temporary visual loss, scintillating lights and evolution of visual changes that we call occipital (or visual ) migraine. We do not know the actual cause.