Separation initially due to witch hunting that maintain throughout centuries:
In our world, we have an historic of witch hunting and exterminating different people, so we can imagine real magician would be persecuted worldwide.
If the muggles/magician ratio is favourable to muggles, even with offensive magic, the magician will not be able to take control of muggles society.
Consequently, in order to avoid persecution, magicians will start to hide from muggles, thus creating their secret society.
Over time, magicians will gradually improve theirs hiding capacities to the point that muggles are no longer able to find any magician and start thinking they where exterminated.
After that, the existence of magic will slowly change into a myth in Muggles society while magician society keep hiding, convinced that detection by muggles will lead to theirs extermination.
Thereby, we get a society where muggles think that magic isn't real and magician don't want to be discovered and live in an hidden society.