Quantization automatically corrects the timing of notes in a performance by moving notes that are played a little out of time—referenced to the note values of the musical grid—to the nearest gridline. Quantization can be applied both to MIDI, and also to audio on tracks that have Flex activated.
The user chooses the gridline value as a point of reference which depends on the fastest notes in the performance. When Quantization is applied, it will move all notes that don’t fall exactly on the gridline value to the nearest gridline, creating a perfectly-timed performance.
Read more about this here: https://www.macprovideo.com/article/logic-pro/quantizing-in-logic-the-essentials