Short: Xiaomi doesn't need to know, but since they are Chinese company, it's their job to know.
Long: In China, law orders companies to collect user data and share them with the government on their request. That's not all; almost all chinese apps have backdoor integrated because they are required to do so. You won't find end-to-end encrypted apps in China for a reason.