Bishops and knights don't have the same exact value.
Bishops are perhaps quarter-pawn more valuable than knights.
But why are these two pieces worth almost the same value?
Let's first look at the advantages and disadvantages of both pieces:
When it comes to range, it's obvious that the bishop wins because he can move as far as possible. For sure, later in the game, this is powerful.
The knight needs several moves to get from one side of the board to the other. Because of this reason knights must normally be placed in the center of the board to be effective.
Access To Squares
A bishop have one major weakness because it only can access half of the board. A bishop can not attack or defend the squares of the other color.
A knight can move to all 64 squares and this is an advantage in its eternal battle with the bishop.
Another advantage for the knight is that he can jump over other pieces. This is very usefull when the board is full of pieces and escape routes are difficult to find.
You Have More Bishops
You want an open board that features plenty of free diagonals for your bishop to travel.
This will maximize the potential for your bishop to control large portions of the board.
Try also to control of the center of the board. Then your bishops can attack or defend both flanks at once. This can be very usefull in an endgame where some pawns are still left on both sides of the board.
You Have More Knights
If you have the extra knight, you want the opposite. A knight thrive in closed positions, in which its ability to jump around blockades and locked pawn structures will trump the bishop's long range.
Endgames with pawns clustered on one side of the board favor the knight, because of his ability to cover squares of both colors.