A prosecution barrister in a Crown Court (or occasionally in a Magistrates' Court) represents the Crown Prosecution Service. It's his/her job to seek a conviction against the defendant through outlining the CPS's case, by presenting evidence and calling witnesses.
The defence barrister works on behalf of the defendant, seeking to obtain an acquittal, through identifying weaknesses in the CPS's case and by providing evidence and witnesses to back the defence case.
Both barristers are allowed to cross-examine witnesses put forward by the other side, to try to discredit their evidence (or to show that it's not relevant).
In a County Court the person who is making a civil claim against another is entitled to be represented by a barrister who will, for example, seek to show that the claim is a valid one by providing evidence of the work done by the claimant (for which he is demanding payment). The person who is defending the action may also choose to use the services of a barrister, who will seek to show that the claim is not a valid one (e.g. because the work wasn't of an acceptable standard or because the full payment agreed between the two parties has already been made).