In the third season of B5, the owner wanted to can it and the outcry got too much as season three ended with Z'ha'Dum and that was a huge, monsrtous cliffhanger... So the the network heads OK"ed a fourth season and then proceed to sell the rights. Unable to secure the final season, JMS wrote the final episode of season four - "
which closed the story of the Babylon Station so the readers wouldn't be left hanging.
Season five was planned out in the "book" kept by JMS. However, it was not written until after the end season 4.
I was reading JMS's writing online at the time and he always planned the fifth year into his story arc. He wanted to write what happened the year after the big climax of the war between light and dark, when the old races left the universe and the various alien races were free to do what they pleased.
JMS has complained about stories that end with the big battle and then never mention what happened after. So when he did get a season five, All of the plot lines of the previous four years could once again twist and turn around each other to reach some conclusion. AFter all, the battle for earth in season four is much more exciting than the battle at Coriana 6 where the Vorlons and Shadows leave the galaxy.
I like season five in that it shows that after the two big, climactic battles, there are still problems and still troubles hanging around. The victory is not clean and simple. THe peace is messy and filled with strife.