Each has its advantages as well as disadvantages.
The tires can only provide so much traction, which is especially important in wet conditions.
In FWD, front tires steer, as well as drive, as well as carry most of the weight on them.
In RWD, front wheels steer, rear drive, weight is distributed close to evenly.
Generally, FWD is safer because it does not require as much experience to handle than RWD. Understeering from FWD is easier to control than RWD's oversteering from experience perspective.
Weight shifting also plays a big role. When accelerating - weight shifts to the rear wheels, when braking - to the front. In RWD, slight engine braking during a turn would create more weight transfer to the front, creating a better grip (do not do this with e-shift).
I would also like to throw in the fact that Manual Transmission allows better ability to control oversteer or understeer. There are 2 reasons:
1) When wheels loose traction, they spin at the constant speed, rather than accelerating.
2) Clutch can be used to disengage engine input to avoid acceleration or engine braking to provide neutral handling.