Your unique method of phrasing a question leaves plenty of room for dissertation; the etymology of the phrase is disputed. Some references suggest early 14th century but provide no firm qutotations in support. The first quotable reference is a newspaper artilce. The New York Times published an article in September of 1893 using the phrase which is the earliest I find.
The actual meaning is one of those metaphors that everyone seems to inherently understand. It describes the indulgence in idleness resulting in wasted time that could have been put to better, more productive use... hence, the "killing" of that amount of time wasted, since it can never be retrieved...