  The generation of very high quality electron bunches (high brightness and low
energy spread) from a plasma-based accelerator in the three-dimensional blowout
regime using self-injection in tailored plasma density profiles is analyzed
theoretically and with particle-in-cell simulations. The underlying physical
mechanism that leads to the generation of high quality electrons is uncovered
by tracking the trajectories of the electrons as they cross the sheath and are
trapped by the wake. Details on how the intensity of the driver and the density
scale-length of the plasma control the ultimate beam quality are described.
Three-dimensional particle-in-cell simulations indicate that this concept has
the potential to produce beams with peak brightnesses between $10^{20}$ and
$10^{21}$ $\mathrm{A}/\mathrm{m}^2/\mathrm{rad}^2$and with absolute projected
energy spreads of $\sim 0.3~\mathrm{MeV}$ using existing lasers or electron
beams to drive nonlinear wakefields.
