PurposeThis study explores distinct capital structure patterns between private and public companies, examining the varying influence of determinants on debt choices contingent upon a firm’s existing debt position.Design/methodology/approachEmploying annual data from 2012 to 2022 for 142 public firms and 660 private firms in a large emerging economy, we use quantile regression within a panel data framework to study the heterogeneous effects of debt determinants, incorporating firm and time random effects.FindingsOur findings indicate that such factors as size and operating margin contribute to higher levels of debt, while investment opportunities reduce the debt level. Further analyses, when accounting for a firm’s likelihood of being publicly traded, reveal that dividend payout and operating margin significantly influence debt levels, exclusively in the presence of high debt proportions. Conversely, investment opportunities emerge as a substantial determinant in all debt scenarios. In addition, we found a strong persistence in the indebtedness of companies, and we conclude that the effect of the determinants of indebtedness is heterogeneous according to the level of debt of companies.Originality/valueThis research provides a comprehensive comparison between private and public firms, not only in terms of debt levels but also in key capital structure determinants, highlighting their significance within the context of varying debt levels.