Contacts on iPhones and smartphones are not stored locally but are synchronized with email accounts. The primary storage is on the email server, with a local copy on the device for offline access. Syncing allows changes made on any device to be updated across all connected devices. You can sync contacts with various email providers, enabling access from multiple devices. This method ensures convenience and seamless management of contacts across platforms.
When you add and enable the Contacts feature on your iPhone, it provides you with the ability to sync your contacts with a specific email account. This email account can be from various providers such as Google, iCloud, AOL, Exchange, Outlook, Yahoo, or any Other email client server that supports contact synchronization.

Please see the pic below for a better understanding...
