Lightning has been synonymous with speed for many centuries. It is, after all, a natural phenomenon known to everyone in the world, that is evidently rapid.
A sure sign that something is considered to typify a particular property or characteristic is its use in an 'as X as Y' simile. Lightning was awarded that meaning as early as the 17th century. For example, Thomas Comber used it in the devotional text, A Companion to the Temple, 1676:
"Now if the
Attendants be bright as the Sun, quick as Lightning,
and powerful as Thunder; what is He that is their
'Greased' is clearly an intensifier, which has been a linguistic device ever since people first felt the need to exaggerate. In the way that people were first 'mad' and those who were a little more mad were 'raving mad' and the more mad still were 'stark, raving mad', 'greased lightning' is meant to convey the meaning of 'very fast lightning'. Incidentally, lightning bolts don't travel at the speed of light as one might imagine and their speed is variable depending on atmospheric conditions. They are fingers of plasma, not beams of light and their rate of transmission is considerably slower than that of light.
The first uses of 'greased lightning' are from the early 19th century. For example, the English newspaper, The Boston, Lincoln, Louth & Spalding Herald, published a story in January 1833, which included the text "He spoke as quick as 'greased lightning'".