Aspect ratio is the ratio of frame width to height. 16:9 is standard for landscape video, 9:16 for vertical, 1:1 for square, and 2.39:1 for widescreen cinema.
Its compression relevance is mostly about what happens when it is wrong. Fitting content of one ratio into a frame of another leaves black bars — letterboxing above and below, or pillarboxing at the sides. Those bars are pixels, they are encoded, and they occupy part of your bitrate budget.
In fairness, they are cheap pixels: flat black areas are extremely easy to compress, so the cost is much smaller than their share of the frame suggests. But two costs are real. The bars consume resolution — a 1080p frame with heavy letterboxing contains perhaps 800 lines of actual picture, so you are paying 1080p prices for less than that. And on a tight target, cropping them is a genuine saving for zero quality loss, because you are removing content that carries no information.
The other half is destination matching. A landscape clip uploaded to a vertical feed will be pillarboxed or cropped by the platform, and the platform's crop is not necessarily the one you would have chosen. Cropping deliberately, before upload, keeps that decision.
The practical order for a hard size target: trim the duration, crop away bars and dead space, match the resolution to the destination, and only then reach for a quality setting.