"in addition; in excess," a variant of to (prep.) originally used when the word was stressed in pronunciation. In Old English, the preposition (go to town) leveled with the adverb (the door slammed to). Most of the adverbial uses of to since have become obsolete or archaic except the senses "in addition, besides" (Old English), "more than enough" (c. 1300). As this often fell at the end of a phrase (tired and hungry too), it retained stress and the spelling -oo became regular from 16c.
Use after a verb, for emphasis (as in did, too!) is attested from 1914. Slang too-too "excessive in social elegance" first recorded 1881. Too much is from 1530s as "more than can be endured;" sense of "excellent" first recorded 1937 in jazz slang. German zu unites the senses of English to and too.