The easiest way to think of this is with an image. When you're close to your subject, you'll be able to use a wider lens, which emphasizes the distance between the subject and background by making the background smaller.
In contrast, if the camera is far away from the subject, you'll have to zoom much farther to get the same size of subject relative to the frame. Think of it as narrowing your frame of view. What this does, however, is show a smaller part of the background. That in turn makes the background appear larger (or closer) relative to the subject.
The difference technically is explained quite well here.