Exiting Switzerland after entering Italy

I arrived in Rome last week and there was no passport control. I scanned my passport in a machine, it took my picture and the gate opened. I even asked a policeman if I needed to talk to someone and he said no. I don’t have any stamps in my passport.

I will be leaving Europe from Zurich on Sept 7. I understand both countries are in Schengen area. Will this cause me any issues at the Zurich airport? I can’t seem to find any info on this. How will they know I entered in Italy if Switzerland is not part of the EU? Are the systems connected and they will see electrically where I entered?

Many thanks everyone