Why can the POCO X7 only charge up to 80% and not 100%?

It is due to you having enabled the battery health protection or smart charging protection feature.
You can turn off this feature by following the steps below:
1. Open the [Settings] APP;
2. Tap [Battery];
3. Select [Battery protection];
4. Select [Regular charging], which will allow the phone to charge up to 100%. The battery health protection feature is designed to extend the battery’s lifespan and protect it. In the global version, there are two options in the battery protection settings: regular charging and smart charging protection. In the Indian version, there are three options: regular charging, smart charging protection, and global battery protection.