Old English spearca "glowing or fiery particle thrown off," from Proto-Germanic *spark- (source also of Middle Low German sparke, Middle Dutch spranke, not found in other Germanic languages). Electrical sense dates from 1748. Old French esparque is from Germanic.
Slang sense of "a gallant, a showy beau, a roisterer" (c. 1600) is perhaps a figurative use, but also perhaps from cognate Old Norse sparkr "lively." Spark plug first recorded 1902 (sparking plug is from 1899); figurative sense of "one who initiates or is a driving force in some activity" is from 1941.