5-on-4 in basketball is when there are five offensive players against four defensive players in a fast break setting. The offensive team with a man advantage will try and push the ball up the court and score as quickly as possible before the trailing defender recovers. The defense is just trying to slow down the offense enough to allow the trailing defender to make his way back into the play. Besides in a game setting, some coaches will use 5-on-4 drills to improve their team's defensive rotations when they are at full strength or to get ready for fast breaks that happen in game.
The main goal in basketball on offense is to score no matter the situation. When the offense is given an advantage like a 5-on-4, they must push the ball up the floor and use this advantage while its there to score as quickly as they can. Offenses that can score the ball efficiently in these situations move the ball quickly through passing that does not allow the defense recover in time to guard the open man who gets a good shot almost every time down.
The main goal on defense is to keep the opponent from scoring. When given a disadvantage through a slower trailing player or a player who gets hurt and goes down, the defense must do what it can to hold off the offense for that possession. By moving quickly and having good rotations, the defense can force an average or contested shot making the possession a win for the defense even if the offense ends up scoring.