What is the essence of the investiture dispute in Western Europe? Who started it, who won it?

What is the essence of the investiture dispute in Western Europe? Who started it, who won it? Why did the dispute about investiture drag on so long that it was not the social forces that started it that won?

A dispute began about the investiture of the pope against the emperors, who had previously decided for themselves which of the clergy would become bishops in their domain. Relying on the administrative system of Gregory VII, the popes defeated the emperors, by the beginning of the 14th century they were themselves defeated by the national kings, who conspired with their clergy against Rome, as, for example, Philip IV the Handsome did in France.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.