This diagram, from the handbook to my 50+ year old MPP 5x4 camera, neatly illustrates the use of a shift lens to overcome the classic problem of converging verticals in architectural photographs.
Of course, these days it's a relatively simple matter to achieve this effect using the tools in Photoshop. But this does lead to a loss of definition especially in the upper (expanded) part of the image, and the end result does not resemble what was seen through the viewfinder. Another problem is that if the perspective is corrected in post-processing, some of it will be cropped from the resulting trapezoidal frame; this may cause part of the intended image to be lost.

A similar principle applies when pointing the camera downwards, and this can be useful when photographing atriums and stairwells:

Of course these principles also have an application in, for example, product and food photography:
