This could get messy.

Facing tens of billions of dollars in wildfire liabilities, Pacific Gas and Electric on Tuesday filed for bankruptcy protection, a step that the company has said was its “only viable option.” But some PG&E investors, elected leaders in its home state of California and public interest groups contend that bankruptcy is not needed and will hurt millions of ratepayers and anybody who owns shares in the utility or does business with it.

That fundamental disagreement about the company’s financial health is one of the main reasons the utility’s bankruptcy case could drag on for months. The filing will create uncertainty for the company’s creditors and people who have lost homes and loved ones to fires that were started by PG&E’s equipment and are seeking compensation from the company. The case could also cost the company hundreds of millions of dollars in fees, to Wall Street and white-shoe law firms.

PG&E’s bankruptcy could have consequences far beyond its immediate winners and losers. The bankruptcy could shape California’s response to climate change and the threat of catastrophic wildfires.

Why did PG&E file for bankruptcy protection?

At first glance, PG&E appears to be solvent. At the end of September, the company’s assets exceeded its debt by about $20 billion. What is at dispute is just how much the company owes for starting wildfires in 2017 and 2018. The utility says it could be on the hook for $30 billion.