Resizing an image sounds like one operation, but there are two separate decisions hiding in it, and getting either wrong produces the classic "why does this look soft / squashed?" result.
1. Aspect ratio: stretch, fit, or crop
An image has a shape (width ÷ height). If you resize a 4000×3000 photo (4:3) to 1080×1080 (1:1) by typing both numbers, the pixels get squeezed horizontally. There are really only three honest choices:
Fit : scale until one side matches, keep the shape. You get 1080×810, not a square.
Crop then scale : cut a 3000×3000 square from the centre, then scale to 1080×1080.
Pad : scale to fit, then add bars to fill the square.
Stretching is almost never what anyone wants.
2. Resampling: how new pixels are invented
When you shrink 4000 px to 1080 px, each output pixel has to summarise several input pixels. Common filters:
Nearest neighbour : picks one pixel. Fast, but jagged; only good for pixel art.
Bilinear : averages 4 neighbours.…