The first thing I'll get out of the way is that any lens can be used for a portrait. It all depends on what you want to show: head crop, head and shoulders, full body, group portrait, environmental portrait (where you show the person in context), quirky perspective, etc. But for the rest of the article I'll limit discussion to classic head and shoulder portraiture, where you want to flatter your subject without excessive need for post-processing. The most important concept to understand here is perspective distortion.
Perspective distortion is influenced by the distance one stands from the subject. If you are near to your subject then extension distortion will cause the parts of the subject that are closer to the lens to appear abnormally large. This tends to exaggerate facial features, particularly the nose, since this is the part of the face closest to the lens. Most models do not want their nose exaggerated!
The opposite type of perspective distortion is compression distortion. If you stand farther away from your subject then distances are compressed; closer parts are relatively smaller than distant parts. This has a flattering effect on people, as it minimises their nose, chin and ears, making their eyes look relatively larger.
Both of these effects are relative to a "normal" distance you might stand to get a "regular" perspective. Some say this distance is about two metres, a comfortable distance between people who do not know each other well.
Perspective distortion is only influenced by how far you are from your subject. It has nothing directly to do with the lens or camera. It has nothing to do with the focal length and nothing to do with the size of the sensor or film you are using. However, if you are using a wide-angle lens you will need to be closer to fill the frame with your subject. This will lead to extension distortion, which is why it is also commonly called wide-angle distortion. And likewise you need to stand back when using a telephoto lens, so you will be able to capture more than a nostril. And this leads to compression distortion, AKA telephoto distortion.
Note that the term "distortion" is here used in a purely geometric way. It is not a mistake or flaw in the lens that produces this distortion; it is a simple fact of optics.
The size of your camera's sensor also plays an indirect role. If you have a so-called "cropped sensor" (like the APS-C size Pentax, Sony and Nikon have standardised on), then a lens of a given focal length has a field of view 1.5x smaller than it would have on a "full-frame" (that is, 35mm film) camera. This means you will have to stand back further to frame the same portion of your subject.
This whole "crop factor" issue is a major source of confusion for anyone new to digital photography. Here is the simple scoop: An 90mm lens is always a lens of focal length 90mm no matter what camera it is on. The lens does not magically change its optical properties when attached to a different body. But on an APS-C camera, part of the image circle the lens produces is wasted. Since the sensor is smaller in size, the lens produces a smaller field of view. It is the image circle that is being cropped, hence the term.
The classic focal lengths for head and shoulder portraiture on 35mm film (and full-frame digital) lie in the range of 80mm to 135mm. We now know why: when using these lenses a photographer can stand far enough away from their subject, perfectly framed, and have compression distortion do its best work.
There are also practical concerns. Lenses of this length keep the photographer outside of the person space of the model, allowing them to relax more. But still one is close enough to communicate with the sitter, both on practical matters (pose) and in order to put them at ease. These lenses are also usable in a studio of modest size. It is true that pro fashion shoots in large studios might use lenses of 200mm or even more. In these situations the photographer has other staff on hand to tend to the model's needs.
If you look at what lenses were available in film days there were many in the range just described, particularly 85mm, 100mm and 135mm. There is nothing magical about these exact values; they are just what got standardised. Given a crop factor of 1.5, photographers on APS-C digital should be looking for lenses between 53mm and 90mm for portraiture.
This partially explains the continuing fascination with 85mm lenses. People pay over the moon for discontinued models while manufacturers continue to release new units in this exact focal length. That is because it is in the perfect range on both full-frame and APS-C. Also, it must be said, photographers are as superstitious and hide-bound as anyone else. If it has worked in the past for thousands of successful photos, why not give it a try?
I will note here that Pentax, rather than blindly repeating the past, have adopted a policy of releasing equivalent focal lengths to the old film standards for their APS-C range. This is why they have no current 85mm lens, but do have a recent DA*55mm, which produces exactly the same field of view. You can get a flattering portrait without standing too far away from your subject. It makes sense, but only Pentax have followed the logic through to its ultimate conclusion.
That's one of the reasons I like them.