Why is aspect a property of the camera and size of the renderer?

I am trying to understand the relationship between camera and renderer.

When I call renderer.setSize() to, say, half the previous size, the resolution of the image changes, but the size of the objects does not increase. My interpretation of that is that the camera renders to some intermediate units and those units are then mapped onto pixels by the renderer.

However, if I call renderer.setSize() and only reduce the x size for example, without updating camera.aspect, the aspect ratio of the objects changes.

This doesn’t make sense to me: Why would the aspect ratio change, but the actual size not?

WebGLRenderer.setSize() just defines the resolution of the canvas (by taking into account the pixel ratio). When rendering with a perspective camera, it’s recommended that its aspect ratio should always be updated as soon as the canvas is resized. Otherwise the final image is distorted since the aspect ratio of the camera does not match with the one of the canvas. Hence, always do this when resizing:

camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();

renderer.setSize( window.innerWidth, window.innerHeight );