Rey reflects her grandfather’s force lightnings, so that the Emperor kills himself.