Genius is characterized by divergent thought that feeds back with the external environment (society, historic events, etc.)
Insanity is characterized by this same divergent thought with the feedback being self-referential only. Thus it isn’t grounded in any way that society recognizes.
With that, neither genius nor insanity requires anything other than a highly divergent thought process marked by a level of attachment or detachment to society.
It occurs in most of us, though for far shorter than it should. If flashes of genius are rewarded they can grow, but mostly, harsh reality stifles the optimistic hope at it's root.