What is the origin of the slang term 6?
It's homophonic of 溜, which means proficient, smooth (in doing something) in Nothern dialects. Note it doesn't imply a top degree of mastery. It's more like nice instead of pwned.
The use of number 6 first appeared in online games, then spread to internet contents.
Some examples for the original word:

他爬树很溜（儿）。He's good at climbing trees.
他说的很溜（儿）。He gave a fluent speech.

One reference I can find: http://hs.tgbus.com/wenda/201410/20141002121649.shtml