The Ents were walking and talking tree-like beings who dwelled in Forests, most famously Fangorn Forest. What was the original purpose for Ents in Middle-Earth?
To protect plantlife that otherwise could not protect itself (especially from Dwarves)
[T]he kelvar can flee or defend themselves, whereas the olvar that grow cannot. And among these I [Yavanna] hold trees dear. Long in the growing, swift shall they be in the felling, and unless they pay toll with fruit upon bough little mourned in their passing. So I see in my thought. Would that the trees might speak on behalf of all things that have roots, and punish those that wrong them!'
'O Kementári, Eru hath spoken, saying: "Do then any of the Valar suppose that I did not hear all the Song, even the least sound of the least voice? Behold! When the Children awake, then the thought of Yavanna will awake also, and it will summon spirits from afar, and they will go among the kelvar and the olvar, and some will dwell therein, and be held in reverence, and their just anger shall be feared.
[I]n the forests shall walk the Shepherds of the Trees.'
Then Manwë and Yavanna parted for that time, and Yavanna returned to Aulë; and he was in his smithy, pouring molten metal into a mould. 'Eru is bountiful,' she said. 'Now let thy children beware! For there shall walk a power in the forests whose wrath they will arouse at their peril.'
The Silmarillion III Quenta Silmarillion Chapter 2: "Of Aulë and Yavanna"