on kind of impact and structure in place. WTC was steel columns and lightweight steel girders. High temperature from the fire weakened connection between columns and girders and columns were left "unbraced." So they buckled. The inertia from the upper floors was so huge that nothing could stop the fall.
Pentagon building has a different type of construction and was reinforced/repaired not long before the impact.