In typical British fashion, the origin has much been debated. Only dating back to the 1960's (which is really new by British standards!), it is said that it was devised as a marketing tactic by the English Cheese and Milk Marketing Board to promote the sale of cheese in pubs. However, it was also mentioned in the 1837 book Memoirs of the life of Sir Walter Scott by John G. Lockhart, but it was a very vague reference as 'a  lunch for a ploughman.' So nothing really ground-breaking for the history books, but historic nonetheless.