There are many definitions of idea. In the most narrow sense, an idea is just whatever is before the mind when one thinks. In other contexts, ideas are taken to be concepts, although abstract concepts do not necessarily appear as images. In a popular sense, an idea arises in a reflex, spontaneous manner, even without thinking or serious reflection.
Many philosophers and psychologists have studied the question of how ideas are born. Plato was one of the first.