In this paper a mechanism is formulated and a principle is proposed that makes it possible to explain and, in some cases, to predict the shape of secondary flows of Prandtl's second kind that arise in turbulent flows in straight pipes of non-circular cross-section. The effectiveness of the proposed principle is demonstrated by a number of known examples from the literature. The results of this work provide a rational basis for understanding the reasons for the formation and prediction of the shape of secondary flows of Prandtl's second kind in straight pipes of non-circular cross-section.