How it works - Wide Angle vs Telephoto
Fundamental Law: Light travels in a straight line
We saw from Basic that an image can be formed from a pinhole because light travels in a straight line.
Note the size of the image formed.
If we make the box longer, by tracing the light rays, we can see that the image of the candle gets bigger.
This is a telephoto lens.
Alternatively if we make the box shorter, by tracing the light rays, we can see that the image of the candle gets smaller.
This is a wide angle lens.
[And with lens photography this explanation is only slightly more complicated, but basically the same idea.]