Auto-upgrade can vastly improve your Home Village in Clash of Clans without you even trying.

Upgrades are the name of the game in Clash of Clans. The level of a Building or Troops can greatly determine how well your armies or defenses perform during combat. Typically, you'll spend resources such as Gold, Elixir, and Dark Elixir on upgrades.
Now, there's a little-known feature known as 'Auto-upgrade,' which can automatically upgrade your Troops, Spells, Defenses, Buildings, and Walls in your Home Village without consuming any of your valuable resources.
This mechanic is more of a quality-of-life feature aimed at helping players, who've been inactive from the game for some time, catch up with certain upgrades or updates that have dramatically changed the landscape in Clash of Clans.
When Does Auto-Upgrade Happen in Clash of Clans?
Auto-upgrades usually take place after 90 days of inactivity. In this case, "inactivity" means that you do not log into your account at all during this time. It's an automatic feature that cannot be activated manually.

Bear in mind that auto-upgrade can only occur once a year. This is to prevent players from taking advantage of the mechanic to quickly improve their Home Village.
Upon your return to Clash of Clans, you will be greeted with a message indicating which Buildings and Troops have been automatically upgraded "while you were away."
If you're going to be absent for an extended period of time, we suggest connecting your Clash of Clans account to a Supercell ID, so as to not to lose your progression if you delete the game.
What Gets Upgraded with Auto-Upgrade?

Buildings and Troops in your Home Village can be upgraded with the auto-upgrade mechanic. This includes:
- Base Defenses
- Resource Collection Buildings
- Troop, Spell, and Siege Machine Buildings
- Troops (both Elixir and Dark Elixir)
- Walls
- Other Buildings, such as the Laboratory and Hero Hall
Overall, everything except Heroes can be upgraded. But, there is no guarantee that all your Troops and Buildings will be upgraded (or upgraded to the maximum level). Generally speaking, only low-level ones will be given an upgrade.
Also, it's worth noting that the auto-upgrade feature will not automatically upgrade new additions or construct Buildings. For example, if a new Base Defense is added to your Town Hall level, you will not find it built and upgraded upon your return.
Again, auto-upgrade is a catch-up mechanic meant to welcome returning players and somewhat simulate the upgrades that could have occurred if they were active. It is not a good substitute for upgrading normally, nor is it an effective mechanic to exploit for those who rush through Town Halls.