If you want an easy to see experiment, hold the bike by your side and clamp the back brake while rolling the bike forward. See how the rear tire just slides? Now do it again while clamping the front hard. Don't do it too hard or you may cause the bike to endo. Now roll the bike backwards and do the same. Instant example of weight transfer.
For the best braking, use the brake that's in the direction the bike is travelling. Hopefully, that will always be the front brake, or you may be either a stunt rider, or trying to take on a hill that's way too steep.
Also, do what Danno says. Threshold braking with both wheels will let you stop in the best time and distance possible.