Shifting in DFT (FFT)
It is all about defining the support of the DFT.
The DFT is periodic with period of $ 2 \pi $.
Hence on any support of the length $ 2 \pi $ you see all the data.

On default, when using MATLAB's fft() the result is on the range $ \left[ 0, 2 \pi \right] $, namely the Low Frequencies are at the beginning of the output vector.
Using fftshift() the DFT is shifted to match $ \left[ -\pi, \pi \right] $ support which means the DC Frequency is centered.

The same logic works on 2D DFT.