Short answer: It doesn’t. — A tilt-shift lens does not correct the perspective distortion that we often call “falling-over building syndrome”. What it does is to let the photographer avoid the problem.
Here is an illustration of what we are talking about.
The narrowing at the top is just the way imaging works. You see it anytime you look up at a building. Our visual system interprets it for us when we stand in front of the building, but when we see it in a photo it just doesn’t look right.
The problem arises from titling the camera upward. If the plane of the sensor is parallel with the vertical structure, there will be no falling-over building syndrome, “FOBS”.
This photo illustrates how buildings look “right” when the camera is not tilted, held level and aimed so the horizon is in the middle of the frame.
We get way too much sidewalk that way, but it works! Cropping can get us what we want.
Sometimes the camera angle of view does not include all we want when the camera is level. Here is an illustration of that.
The left image models the view with a regular camera lens. The yellow frame simulates the sensor size and shows what the result would be. Note that the building is only partially included.
On the right is an illustration of what shifting of the lens accomplishes. The image is shifted relative to the sensor so all of the building is within the frame. Only the lens shifting is needed for this “correction”, the tilting part of the lens is not used for avoiding the perspective distortion.
There is also a hint there that the image size produced by a tilt-shift lens is much larger than what is produced by a normal lens. The reason, of course, is so different parts of the image can fully illuminate the sensor when the image is moved around. This also makes the optics of such lenses more demanding and expensive.
This is a photo of the Nikon PC Nikkor 19mm 1:4 E ED wide-angle tilt-shift lens. Notice how the whole lens is shifted relative to the lens mount. The range of this lens is 12 mm in either direction. That is half the height of the full frame sensor (about 24 by 36 mm). If you do architectural photography this is a very useful tool.
.:. © 2022 Ludwig Keck