Haikai poems developed out of a tradition of renga or linked verse. Haikai was typically a short verse of three lines made up of 5, 7, and 5 syllables. A second verse would have two lines of 7 and 7 syllables. The third verse would repeat the form of the first and the fourth would repeat that of the second and so on. There was no specific length that was sought, but a common theme or themes ran through the many links in the haikai.
Renga were similar, but there were a great many conventions which governed their composition. Usually, renga linked verses were composed by groups of poets each contributing a verse in turn, but the conventions required a concentration of effort that could stun the mind after a while. Haikai were looser in convention, often funny or scandalous or gross; renga poets would often turn their hand to haikai and a bottle of sake to relax after the strain of composing renga. The larger the bottle of sake, the bawdier the haikai.
Both renga and haikai developed from waka, a more serious form of poetry requiring thirty-one syllables in a 5-7-5-7-7 form.
With both haikai and renga, the evolution of the poem depended entirely on the opening verse, called the hokku or starting verse. If this had sufficient depth for development, the poem could emerge successfully. Thus, the composition of the hokku was of crucial importance and was left to the best poet available. Poetry teachers could quickly teach the fundamentals of continuing a renga or haikai, but a great deal more attention had to go into the teaching of the starting verse. Many masters published collections of starting verses for this purpose.
Basho in particular was famous for this. In fact, he and others began to appreciate starting verses as poems which could stand alone. Basho himself fully explored the 5-7-5 form of the starting verse as a poem by itself. Indeed, he did this so completely that after his death in 1694 no one went further in combining clever witticism, poetic insight and religious revelation in a mere 17 syllables. Through the rest of the Edo period and to the present there have been various developments away from the standard set by Basho, but in the end there is always a ‘Back to Basho’ movement which brings the form back to his level of perfection which has not been repeated.
Haiku? The word was invented in the 1890s when Masaoka Shiki convinced the world of poetry that the form of the starting verse as an independent poem had been established long enough (over two centuries) to merit a word descriptive of a stand-alone poem: the haiku.