Where does the iPhone save contacts?

Does the iPhone save contacts in the internal storage, SIM card and iCloud (if activated)? I can see an option in Contacts to import from SIM.
I wonder if the iPhone stores contacts in all these places.


Solution 1:

iPhone stores contacts in the location set by Settings → Contacts → Default Account. New contacts are stored on the internal storage of the device, and then synchronised with the account selected here. This can be iCloud if activated and selected.

Contacts can be imported from the SIM, but not saved to the SIM.

Solution 2:

Storing contacts on sim card is a feature of older phones before internal storage was really a thing. the iPhone has the ability to import those contacts from the sim, I believe since day 1. However it has no ability to write the contacts to the sim.