One of the many ways an attorney can be liable for legal malpractice is by representing parties whose interests are not aligned.
The California Rules of Professional Conduct prohibit attorneys from undertaking the representation of parties whose interests conflict. This can happen in a variety of situations, including when a lawyer represents multiple parties at the same time, takes a client whose interests are adverse to those of a former client, and sometimes in business partnerships. If an attorney represents conflicting interests and causes you harm, the attorney can be liable for those damages.