To answer your question the bark does for the tree what your skin does for you. It’s an outer protective layer.
The thin layer that is just underneath the bark, the cambium, is the only part of the tree trunk that has living, growing cells. It is what makes the trunk, branches and roots grow thicker over time.
A tree’s rough outer and inner bark help guard the cambium against damage by weather, insects, animals, and organisms that can cause disease. A tree can survive if some of its bark is stripped away. But if too much is removed, the tree will die.