See how focal length and where you stand change the size of the background relative to your subject. Companion to the Portrait Compression Simulator and the Portrait Focus Planner.
Drag the camera or the background in the diagram, or use the sliders. The diagram rescales to keep both in view.
Compression is not something the glass does. It comes from where you stand: the ratio of camera-to-subject distance to camera-to-background distance. A longer lens only forces you far enough back for that ratio to climb toward 1, where the background is drawn as large as the subject.
Distances are measured from the camera's sensor plane with the lens focused on the subject. The camera sits 1.5 m above the ground and is aimed to frame the subject, without tilting the verticals.