loose flaps
We have a basic (non RFID, non magnet etc) cat flap.
If an interloper cat is deranged enough to enter
One (or more) of the resident cats will either have their wicked way with the interloper* and / or rip it to shreds.
.. Not 100% perfect - we did accidentally acquire an extra female cat as alpha male took a shine to her and so other cats were not allowed to hassle her (she became de facto alpha female) and she ended up moving in as she preferred the conditions at our place! .. but at least that system reaches a happy equilibrium.