Treants are, of course, ents. I can only assume they’re called “treants” for the same reason that the humanoid creatures who are obviously hobbits are called “halflings”: a dispute over usage rights with the Tolkien estate. (This may also be why Dungeons and Dragons has always spelled “warg” with an o instead of an a.)
Treants are chaotic good, and good usually means “friendly,” but not always. Evil displeases them mightily, but so does any kind of civilization encroaching on their turf. Even if one doesn’t do anything to hurt them or the trees and forests they care for, they still may get annoyed enough with trespassers to want to teach them a lesson about treading where they oughtn’t. In this last case, their primary goal is deterrence, and if they can’t drive the trespassers out, they’ll attack to subdue, then take out the trash themselves.
Another thing to like about treants is that they’re resistant to bludgeoning and piercing damage but not to slashing damage. Anytime fifth-edition D&D bothers to distinguish among the three different types of physical damage, it gets a thumbs-up from me. Note also that treants are resistant to any kind of bludgeoning or piercing damage, even if it comes from a magical weapon.
With their extraordinary Strength and Constitution and poor Dexterity, treants are straight-up brutes. They have a ranged weapon attack in the form of lobbing rocks, but they’ll mostly do this only while walking toward someone they perceive as an enemy. Once they get within striking distance, they’re all about the slam attack—which they get two of per turn, thanks to Multiattack.
Treants are vulnerable to fire, but they’re not scared of it per se. Rather, it angers them and draws their ire. Only if an opponent deals it at least moderate fire damage (41 or more points in a single turn) does a treant get scared and take evasive action. Having decent natural armor and a lot of hit points, it will back off—heedless of opportunity attacks—and hurl a rock at whoever dealt the fire damage when it’s at least 30 feet from its former melee opponent(s) but no more than 60 feet from that target. Note that, per page 198 of the Player’s Handbook (“Knocking a Creature Out”), melee attacks can be declared nonfatal, but ranged attacks are always lethal. Giving a treant a second- or third-degree burn is the one sure way to eliminate any qualms it has about killing people.
Once per day, a treant can Animate Trees, turning two nearby trees into quasi-treants. These aren’t the same as awakened trees: they do Siege Monster damage to inanimate objects, and while they’re stronger and much tougher, they lack the sentience of an awakened tree. In essence, they’re like woody drones directed by the treant which can make only a single slam attack each turn. (Although the stat block isn’t direct about it, a fastidiously literal reading—always a good idea in 5E—implies that animated trees don’t get a Multiattack.) A treant will Animate Trees only if it feels genuinely threatened, which is to say, if the combat encounter difficulty (as calculated per the “Combat Encounter Difficulty” formula on pages 82–83 of the Dungeon Master’s Guide) is merely easy or medium, or if its enemies launch a surprise attack and manage to do 41 or more points of damage to it before it can act.
Generally speaking, treants are loath to fight in the first place. They aren’t proficient in any social skill, but their high Wisdom indicates a preference for talking things out and issuing warnings before coming to blows, as well as an ability to size up the level of challenge their opponents present (again, per “Combat Encounter Difficulty”). If their opponents are too difficult to handle alone, they’ll issue a booming call for aid, and you can have enough additional treants show up in the third through fifth combat rounds to level the playing field. Again, however, unless their opponents are setting fires or spraying poison or acid willy-nilly, they’re going to stick to nonlethal melee attacks as much as possible, then carry their unconscious foes to the nearest edge of the forest (which isn’t necessarily where they entered from or where they were going) and huck them a good distance away.
In some instances—for instance, if a group of low-level player characters encounter one of these CR 9 entities—a treant may decide that its opponents aren’t even worth pummeling. In this case, remember that you do have the option of having the treant make an ordinary Attack action to grapple, which is to say, to pick an opponent up off the ground. Being Huge creatures, they can carry a Medium or Small PC—or two!—without even being slowed down, as well as order a couple of animated trees to do the same. Then they can march to the edge of their territory, put their opponents down (or toss them, if they’ve been annoying), give them a pat on the behind and send them on their way.
All that being said, when a long-lived, peace-loving treant determines that its opponents need to die, it’s not only going to start that fight, it’s going to finish it. Its foes can try to surrender, and maybe it will be moved to accept and stand down. But it’s not going to let its own injuries hold it back from what needs to be done, nor will it ever allow itself to be taken as a prisoner. By Rillifane, it will end the threat to itself and its forest home or die trying.