Prison is a ban, its a 'player punishment' regulated to the form of a chracter lock for doing something wrong, ie the Magistrates, but I didnt do anything wrong, except play the game...
It shouldn't be. IC bans are not player punishment either, they are normal things to be expected once in a while.
If you fight against the odds and instruct your troops to fight it out to the last man, you are likely to be emprisoned. It's alsways a bit of a dice roll, of course, but when you bet high you can lose big.
If you use small retreat percentages and fight conservatively, you won't go in prison. You won't win big either.... it's always a choice.