Tree of Harmony

The Tree of Harmony is an Equestrian magical tree that holds the Elements of Harmony. It is located in the Cave of Harmony in the Everfree Forest, near Princess Celestia and Princess Luna's old castle. The center of the tree has a star shaped like Twilight Sparkle's cutie mark, while Celestia and Luna's cutie marks are on the trunk.

Depiction
In Princess Twilight Sparkle - Part 2, Twilight Sparkle experiences a flashback where she learns that Princess Celestia and Princess Luna discovered the Tree of Harmony a thousand years ago. The princesses took the Elements of Harmony from the tree and used their magic to defeat Discord.

According to Celestia, the tree controls and contains all that grows in the Everfree Forest, even without the Elements in it.

Twilight Sparkle and her friends discover that the Tree of Harmony has lost its magic, allowing Discord's plunderseeds to sprout and grow all over the Everfree Forest, slowly killing the tree. Twilight and her friends give up the Elements of Harmony and return them to the tree, recharging its magic and restoring the forest.

When the Tree of Harmony regains its magic, a flower sprouts at its roots. The flower blooms to reveal a chest with six locks. Princess Celestia tells Twilight that she doesn't know where the keys are. Celestia assures Twilight that it is a mystery she will not be solving alone.

In Twilight's Kingdom - Part 1 and Twilight's Kingdom - Part 2, the tree is seen again with the Elements of Harmony still on its branches and the mysterious chest still in front of it. At the episode's climax, the tree activates the elements and connects them with the rainbow power that came from the chest. The tree then transports the chest into the ground in Ponyville, which sprouts into Twilight's new castle. The new castle partly resembles the tree itself.

The tree is mentioned by Rainbow Dash in The Cutie Map - Part 1, giving Twilight an example on what else is there left to do.

Twilight also mentions the tree in The Cutie Re-Mark - Part 1, surmising that its connection to the Cutie Map explains its presence even after the timeline is altered.

In Shadow Play, it is revealed that the Tree of Harmony first grew from a seed planted by the Pillars of Old Equestria and imbued with the elements within them so that it would protect Equestria from darkness in their absence. After returning from limbo, Star Swirl the Bearded removes the Elements of Harmony from the Tree in order to banish the Pony of Shadows.

In The Mean 6, Queen Chrysalis creates artificial clones of the Mane Six in an attempt to seize control of the Elements of Harmony. However, the Tree of Harmony recognizes the clones as fake and destroys them to protect itself.

In What Lies Beneath, the Tree and its abilities have grown to the point of being able to project a physical form of its consciousness (modelled after Twilight Sparkle), and it tests the friendships between the Young Six.

In School Raze - Part 2, the Tree of Harmony's magic prevents Starlight, the Young Six, and the magic of Equestria from being sucked through Cozy Glow's vortex, allowing the Young Six to break free of their imprisonment and defeat Cozy.

Role in the series
The Tree of Harmony's backstory is explored more in the SpongeBob and Friends Adventures Chronicles series. It's revealed that the Tree of Harmony planted by the Pillars was only a reincarnation of the original Tree of Harmony born during the Alicorn God Era by Queen Philosophia, the Alicorn Goddess of Friendship, Love (before others), and Harmony (also before others), and head of all Alicorn Gods. However, the original Tree of Harmony was killed by Pitch Black during his reign in the Fear Wars of Equestria. Starswirl the Bearded reincarnated it from magic gems and a single seed remaining from the original tree. Though this Tree has more mortal personality than the last, it's still just as powerful, but due to this power sending the young new Tree into flux, it allowed Discord's plunderweeds to awaken. It has displayed genuine mortal emotion and concerns such as not knowing it's true purpose or destiny outside of what it was told or what it's created.