I was watching a Living Single marathon and noticed how the opening credits alternated the starring role; first Queen Latifah was the star, then Kim Coles was the star; it continued to alternate. Also was watching Half and Half and the same happened... "Starring Rachel True" then "Starring Essence Atkins" just wondering.
I assume what you're asking about is the order the stars were listed in the credits (where the first one usually gets shown on-screen with the word "starring").
I once did a very long explanation here of how credits work, but the short answer to just about every question about TV credit structure is:
That's how the stars demanded it in their contracts.
In the specific cases you mention, the most likely answer is that both of the people in the those roles were considered "the star" of the show, in that neither of them was clearly more famous or more significant. Stars often demand "top billing" as part of their deal in order to get their name (which is basically the basis of their career) in front of viewers in a prominent position.
In order to keep two people happy who both wanted top billing, the studio may agree to just alternate. I seen this happen on a show-by-show basis as you mention, and also on a season-by-season basis. It all comes down to what the studio needed to do to convince the actors to do the show.