late Old English cepan "to seize, hold," also "to observe," from Proto-Germanic *kopijanan, but with no certain connection to other languages. It possibly is related to Old English capian "to look," from Proto-Germanic *kap- (cepan was used c.1000 to render Latin observare), which would make the basic sense "to keep an eye on."
The word prob. belongs primarily to the vulgar and non-literary stratum of the language; but it comes up suddenly into literary use c.1000, and that in many senses, indicating considerable previous development. [OED]Sense of "preserve, maintain" is from mid-14c. Meaning "to maintain in proper order" is from 1550s; meaning "financially support and privately control" (usually in reference to mistresses) is from 1540s. Related: Kept; keeping.
mid-13c., "care or heed in watching," from keep (v.). Meaning "innermost stronghold of a tower" is from 1580s, perhaps a translation of Italian tenazza, with a notion of "that which keeps" (someone or something); the sense of "food required to keep a person or animal" is attested from 1801. For keeps "completely, for good" is American English colloquial, from 1861.
Forever; permanently: They put him away for keeps/ She wanted to be married for keeps (1884+)