The 's' wasn't added; for some uses of the word anyways, it has always had an 's' on it. The OED calls it an adverbial genitive.
The adverbial genitive was a grammatical form in Middle English; to summarize, 's' was sometimes added to the end of a word to show that it was an adverb. We don't do that anymore, but some adverbs have 's' on their ends as a remnant of this, for example towards, forwards, besides, and always. Anyways is one such remnant. The OED has the first citation in 1560:
all those who are any ways afflicted ... in mind, body, or estate
Of course, anyway is not always used as an adverb:
Why did he move there anyways?
For this usage, it historically did not have an 's' on it.
However, since the 's' is now meaningless, I suspect that people who add the 's' for the adverbial usage of anyways often also add the 's' when it is used as a conjunction. The OED labels this "dial. or illiterate".