Why A 10x probe forms an RC divider with the scope input capacitance, and the probe's trimmer capacitor must be set so the capacitive divider ratio matches the resistive ratio at all frequencies. A square wave is the ideal test signal because it contains a wide spread of harmonics, so any mismatch shows up immediately as rounded or overshooting corners. You connect the probe to the scope's built-in calibrator output (typically a 1 kHz square wave) and tweak the trimmer until the flat tops and bottoms are truly flat.
Watch out Adjusting on a sine wave for maximum amplitude is tempting because compensation does affect high frequency response, but a single sine frequency cannot reveal the low frequency droop or high frequency peaking that a square wave exposes at once. DC voltage and timebase accuracy are separate calibrations that a probe trimmer does not control.
Square wave in, flat tops out. Rounded corners = under, overshoot = over.