The logic is that the angle subtended by each element in the picture should be the same as the angle subtended at the camera by the same element in the original scene.
Often, this gives a unique three-dimensionality to the image, the 'magic' perspective. The eye/brain can accommodate quite wide variations, so the 'magic' is seen across a few inches either side of the 'magic' distance, but outside that range, it is normally lost.
Small pictures are normally examined from closer than big ones, so (for example) a 127mm/5 inch lens on quarter plate implies a viewing distance of 5 inches while a 300mm/12 inch lens on 8x10 implies a viewing distance of 12 inches.
This also explains why small formats often use 'long standard' lenses, e.g. 6 inch on quarter plate and 50mm on 35mm: viewing distances for 'magic' perspective would be inconveniently short otherwise. Thus a 5x enlargement off 35mm shot with a 50mm lens should be viewed from 250mm or 10 inches.