Simple setup: A Red LED in front of a small fresnel loupe/lens (credit card size). Using a screw I can adjust the distance between the LED and the lens. The LED is centered with regard to the lens.
My question: I pointed my assembly at a wall 1 meter away and adjusted the distance so that the resulting spot on the wall has the smallest diameter (increasing and decreasing the distance at this point results in the spot to grow and get blurry). Then I aimed at a different wall which is about 4 meters away and the spot got bigger - as expected. However, I was surprised to find that, with the different distance to the wall, adjusting the distance between LED and lens leads to a more focused spot.
What is the reason for this? Why and how does the distance between LED/lens and the wall I am pointing at matter?
A picture for the 3 cases: 1m (diameter 3cm, focus), then turned at 4m (12cm, out of focus), then distance adjusted (10cm, again focus)