Like most nations, Japan has always had some manner of pleasure quarter offering various forms of entertainment, including (of course) the erotic. As Japan cut off all contact with the outside world during the Edo era, the rich merchants of the cities continued to develop the arts of the country in the major urban areas.
With the many courtesans of the time providing one area of fulfilment, the merchants looked for other types of entertainment, including music, dance and poetry. From these early stages, the world of the geisha developed, providing a service to entertain and charm, working alongside the very desirable, and for most people unobtainable, courtesan.