Under what conditions and by what means could Frederick II Staufen finally defeat the popes? If this was not possible, then why?

Frederick II Staufen could have defeated the pope only where the cities became stronger than the feudal lords; they would give the emperor money, soldiers and officials for a lasting civil peace. But in most of Europe, by 1250, cities were weaker than the feudal lords.

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.