Let's start with the lawyer-client relationship that clearly exists in California. You have a signed letter of commitment or an advance agreement. You worked or are actively working on the matter. Something happens that leads you to end the relationship.
Unlike virtually any other industry in existence, lawyers generally can't just walk away. As an attorney, you have an ethical obligation to act in the best interest of the client and minimize the harm you may suffer. This obligation exists even if the customer does not pay you as agreed. You may need to get the customer's consent to withdraw.
If there is an active lawsuit, you may need the judge's consent to drop it. California law imposes a limited duty of loyalty on lawyers that continues after an attorney-client relationship ends. This duty arises in situations during an attorney's proposed representation of a new client, or when their separate business or personal affairs may violate a limited duty of loyalty to a former client. An attorney's duty of loyalty to a client is mentioned, but not expressly defined in the California Rules of Professional Conduct (CRPC).
In general, this duty relates to the disclosure by an attorney of confidential information of a client or a previous client. In addition, California Rule 3-100 states that lawyers have a “duty of loyalty and competence as described in Rule 3-110, which addresses “Failure to Act Competently.” When attorney-client relationships end, it's important to understand the ethical and professional duties that lawyers owe to their former clients. A lawyer can file a claim for damages against a third party that induces the lawyer's client to end the attorney-client relationship. The attorney-client relationship comes to a natural conclusion when the lawyer has completed the services for which he was employed.
Talking to a client on the phone, informally at a party, or via email, text message, or other social media could result in an attorney-client relationship. An attorney-client relationship can arise out of inference from the parties' conduct, even without a fee payment or formal agreement. After concluding a relationship with a client, California law prohibits an attorney (doing anything that could harm the previous client) in any matter in which the lawyer previously represented the client and (using against the previous client) knowledge or information acquired under the previous relationship. The most common ground is probably personality clash, where there is a breakdown in the lawyer-client relationship.