A frontier challenge in implementing femtosecond electron microscopy is to gain precise optical control of intense beams to mitigate collective space charge effects for significantly improving the throughput. Here, we explore the flexible uses of an RF cavity as a longitudinal lens in a high-intensity beam column for condensing the electron beams both temporally and spectrally, relevant to the design of ultrafast electron microscopy. Through the introduction of a novel atomic grating approach for characterization of electron bunch phase space and control optics, we elucidate the principles for predicting and controlling the phase space dynamics to reach optimal compressions at various electron densities and generating conditions. We provide strategies to identify high-brightness modes, achieving ∼100 fs and ∼1 eV resolutions with 106 electrons per bunch, and establish the scaling of performance for different bunch charges. These results benchmark the sensitivity and resolution from the fundamental beam brightness perspective and also validate the adaptive optics concept to enable delicate control of the density-dependent phase space structures to optimize the performance, including delivering ultrashort, monochromatic, high-dose, or coherent electron bunches.