There are several reasons that case name might change. Here are ten of them, roughly in order of frequency:

1. A party is dismissed from the case and hence is no longer a party, so the next person in line becomes the first party listed in the caption.

2. There are several defendants, only some of whom appeal, and only the parties that actually appeal are included in the caption in the appeal. This also happens when not all parties who are part of an initial appeal are parties to a later case in the state supreme court or U.S. Supreme Court because the issues upon which certiorari review were granted only pertain to some parties.

3. A government official or trustee of a trust is sued by name in their official capacity and when the occupant of that office changes, the caption is amended to reflect the new occupant of that office.

4. An entity's name changes during the course of the case, either due to a rebranding (e.g. "X" formerly known as "Twitter") or due to a corporate merger or acquisition, or both.

5. The case is consolidated with another related lawsuit and the other lawsuit is given top billing in the consolidated case caption.

6. A party dies or is legally declared incompetent and their executor or conservator or guardian is substituted as a party.

7. The original caption was inconsistent with the body text of the complaint, or is otherwise misidentified, and the caption is amended to correct the error (e.g. someone erroneously captions the case as against "Apple Industries" when the lawsuit is against "Apple Computer" or puts "J.D. Smith" in the caption when the person sued is actually "J.P. Smith").

8. An individual's name changes during the course of the case (e.g. due to marriage or a religious conversion).

9. A party that was originally listed as a plaintiff is reclassified as a defendant, or visa versa.

10. A complaint that was originally filed as a "direct action" is reconfigured as a "derivative action" or visa versa.

I'm sure that there are other exceptions that don't come to mind.

When you refer to a case that changes name in the middle, you would properly refer to it as *Squarepants vs. Star et. al.* sub nom. *Squarepants vs. Krabs* (this often happens in the case of appeals where only some parties appeal at each level, or where an official party defendant changes mid-case).