The polar ionosphere as a source of energetic magnetospheric plasma