mid-15c., "lawfully begotten, born of parents legally married," from past partixiple of Old French legitimer and directly from Medieval Latin legitimatus, past participle of legitimare "make lawful, declare to be lawful," from Latin legitimus "lawful," originally "fixed by law, in line with the law," from lex (genitive legis) "law" (see legal). Transferred sense of "genuine, real" is attested from 1550s. Related: Legitimately; legitimateness. The older adjective in English was legitime "lawful, of legitimate birth" (late 14c.), from Old French legitime, from Latin legitimus.
word-forming element used to make verbs, Middle English -isen, from Old French -iser/-izer, from Late Latin -izare, from Greek -izein, a verb-forming element denoting the doing of the noun or adjective to which it is attached.
The variation of -ize and -ise began in Old French and Middle English, perhaps aided by a few words (such as surprise, see below) where the ending is French or Latin, not Greek. With the classical revival, English partially reverted to the correct Greek -z- spelling from late 16c. But the 1694 edition of the authoritative French Academy dictionary standardized the spellings as -s-, which influenced English.
In Britain, despite the opposition to it (at least formerly) of OED, Encyclopaedia Britannica, the Times of London, and Fowler, -ise remains dominant. Fowler thinks this is to avoid the difficulty of remembering the short list of common words not from Greek which must be spelled with an -s- (such as advertise, devise, surprise). American English has always favored -ize. The spelling variation involves about 200 English verbs.