In a nutshell
PCA compresses data by finding the directions it varies along most. It centers the data, then computes the principal components — new axes (the eigenvectors of the covariance matrix) ranked by how much variance each one captures. Keeping just the top few and projecting the data onto them discards the least informative directions, cutting the number of dimensions while preserving most of the information.