This work presents a predictive torque vectoring controller that optimally monitors the vehicle limits of handling using active torque distribution in the rear axle of a fully electric vehicle. It works in combination with a feedforward controller designed to improve the vehicle's agility. The overall torque vectoring strategy is described together with the vehicle lateral dynamics, sideslip angle estimator, and torque allocation method. Numerical simulations for various scenarios and road profiles show the benefits of predicting the vehicle's handling limits and the enhancement of vehicle stability in terms of reduced vehicle sideslip angle and driver effort. The proposed optimal control method for predicting vehicle handling limit violations does not require a dedicated solver, making it a promising candidate for real-time applications. The case study is a vehicle equipped with two rear in-wheel motors in the framework of HiPERFORM, an ECSEL Joint Undertaking (JU) European research project. Hardware-in-the-loop (HiL) tests were performed on a dedicated e-axle test bench to integrate the torque vectoring controller with the real e-motors and a dual inverter. The results of the HiL testing demonstrate that the torque-vectoring requirements are satisfied by the hardware configuration in use.