Many other fantasy works have used trolls in the "large, strong and stupid" role of D&D ogres, with the stone-based giants of Pratchett's Discworld and the grey-skinned mountain trolls of Harry Potter being particularly original or well-known examples. The troll of D&D, however, has no real resemblance to these, or to the mythic creature; Gygax instead stated that his inspiration was the 1961 novel Three Hearts and Three Lions by Poul Anderson, which features a regenerating troll, along with a number of other tropes he adopted for the game.
Physically, they are powerful creatures, able to deliver a rapid series of blows, each more powerful than a typical sword-strike, and they have a rubbery hide that's thicker and more resilient than rhino-skin. Even without their regenerative powers, they are about halfway between ogres and the smallest of true giants in their ability to soak up damage - although some of this could be due to simple combat prowess, or a lack of truly vital organs. They also have acute senses, particularly smell (which would explain the large nose).
They seem to live in family groups of up to a dozen, but it's interesting to note that the text description doesn't state that they are any more than mere animals, with no indication that they have language or the ability to use tools. Whether this is intentional is unclear from the Monster Manual alone; their intelligence is the same as both ogres, which have language, and gorillas, which do not, so it could be argued either way.
Aside from proportionately longer arms and nails/claws, the appearance of the 2E troll has not changed from the previous edition. However, as had been clarified in some 1E supplements, it is now apparent that trolls are sentient creatures, with a culture of sorts. They still don't wear clothes or use weapons, and (unusually) they don't have their own language, but they do speak a mish-mash of whatever languages are spoken by other races in their area.
Another unusual point is that the females are stronger and tougher than the males, and they may be more intelligent, too, since they are capable of fairly impressive magic use which they use to bully the males into submission. With two sexes and live birth, it is also implied that they are mammalian, something that wasn't obvious from the prior description.
Although the text description is similar, the illustration shows a creature rather more heavily built and visibly muscular than previous versions of the troll. The nose is narrow and downturned, and the eyes small and bright, rather than wide black pits. The statistics indicate that trolls are significantly stronger than even the strongest humans (or, indeed, most ogres) and are also agile and, as one might expect, highly resistant to damage.
Trolls in 3E typically live in much smaller groups than before. While they are capable of learning magic, it's typically much weaker than that indicated in 2E. Although they still have acute senses, they no longer have the enhanced darkvision of earlier versions. They now speak the same language as giants.
The troll shown here has the greatest physical change yet. The skin seems smoother, although still warty in places, and the hair less like a mass of tendrils. More significantly, the face is much more humanoid, with a bulbous, but not elongated, nose, a jutting jaw, and the same bright eyes as in 3E. There are now clearly five digits on the hands and feet, rather than just four. The troll also wears a loincloth, indicating at least a minimal material culture as well as a sense of personal modesty lacking until now.
5E trolls are also not so extreme as the 3E version in that they are less strong (although still around the human maximum), slightly less agile, and slightly less stupid. Their hide, while still impressive, is also not quite so thick as before.
Game systems with no direct connection to D&D, where they have trolls at all, have tended to base them to a greater or lesser extent on the mythical/folkloric version, perhaps via Tolkien's own interpretation of that being. A particularly notable example are the trolls of Glorantha, aggressive and voracious beings that nonetheless have a sophisticated matriarchal society rich in darkness magic.
In D&D, however, the most significant thing about trolls is their signature power: regeneration. The exact details have varied with the different editions, but it's clearly a very rapid process, with a typical troll regaining about 10% of its total hit points every combat round. Fire and acid forestall the process in some manner, and it's here that the rules differences tend to be most significant.
Trolls can also re-attach severed limbs and it's typically the case that, if they fail to do so, the limb maintains life and independent action for up to 24 hours. This, of course, raises a whole slew of questions if we attempt to justify it according to any real-world logic. It is, after all, a game mechanic.
Many creatures in the real world do regenerate, and some can even regrow lost limbs. Regeneration abilities are stronger in the less sophisticated invertebrates, with a very rough rule that the simpler the animal's internal structure, the better it is likely to be at reforming itself. The most extreme example is the sponge, which doesn't look like an animal at all, and which can reknit itself even if it's literally pulled apart into its separate cells. The troll, it would seem, is something like that.
Unlike sponges, trolls do (presumably) have a fairly complex internal anatomy with multiple different tissue types. But their cells can evidently reknit very rapidly, reforming the requisite tissue at will. This may help to explain their high resistance to damage even before they regain hit points, with cellular rebuilding being so rapid that a given blow is less effective than it would be against regular organic tissue. A punctured lung, for instance, is less of a concern if the puncture seals up almost immediately.
Aside from the speed of the regeneration, the other area where magic must play a part concerns the after-effects of dismemberment. That limbs continue to move and attack after being severed implies that the troll's consciousness is spread through its body even when its parts are detached. Prolonged separation weakens this, with the soul, or whatever it is, retreating to the largest part if the others cannot be re-attached. We can tell this because the torso regrows a severed head, rather than vice versa, although the troll is presumably somewhat incapacitated for the duration.
Trolls do, however, need to eat and breathe, and so can presumably be starved or suffocated. What happens at that point is, perhaps, ambiguous, although a literal interpretation of the rules would suggest that they enter a state of suspended animation, rather than actually dying. If the remains aren't burned, they'll wake up if somehow fed or exposed to breathable air.
The basic attributes of a troll are strength close to, or just beyond, the human maximum, combined with minimal intelligence and above-average agility. The hide is about as tough as mail armour, and they may also take less damage from blows in systems that systems that don't already have regular armour provide that effect. An acute sense of smell is also worth mentioning, where relevant.
Regeneration is, of course, the main property to simulate, and the guideline would be that a troll can restore itself from completely incapacitated to full health in about ten combat rounds - this might well need to be speeded up in systems where fights rarely last that long. It's interesting to note that systems that include the concept of hit locations (or similar) may well make it easier to sever limbs without the need for special rules, making that aspect of regeneration simpler to simulate.