Bus ridership experiences a critical decline. However, the complex causal interactions that impact ridership haven't been well understood. To address this gap, we propose a data-driven causal machine-learning framework employing empirical panel data from 197 cities in China before COVID-19, which allows us to explore the heterogeneous causal effects on ridership and its relevant factors, rather than just focusing on correlation relationships. Our results indicate that the potential gains in bus ridership may be cancelled by the negative causal effect of increasing income, the operation of urban rail transit, ride-hailing, and bike-sharing services. The heterogeneous causal effects and counterfactual inference further reveal the diminishing marginal utility of improving bus services on regaining ridership and the increasing marginal utility of ridership decline due to the inevitable growth of income and private car ownership. Based on causal analysis, we propose a policy matrix that suggests policy combinations for cities in different situations.