1 The idea
Long lenses seem to "compress" the background, but perspective really comes from where the camera stands. From the same spot, a longer lens just crops. Back the camera off to keep the subject the same size, and only then does the background grow.
When putting CG in a plate, the camera distance has to be right, not just the focal length. With the wrong distance the CG perspective won’t sit in the plate even if the size looks right.
2 Hands-on
Zoom in and back off: the background "grows"
Keep "lock robot size" on and move the focal length
Where the numbers come from: Lens maths is the standard thin-lens model (FOV, CoC, hyperfocal), using CoC = sensor diagonal ÷ 1500, a common convention rather than a fixed rule. Distortion uses the Brown–Conrady model (k1, k2). The real DOF images are Blender Cycles renders.