Factorio really is a bit of a modern marvel, even HUGE factories don't seem to run poorly at all and I genuinely have no idea how. Other similar games made since (Satisfactory comes to mind) seem to struggle with things like keeping track of resources on belts at scale, which IMO is a perfectly understandable problem to have but still makes factorio that much more impressive.
You can definitely hit the limits of Factorio. My largest base runs at ~10fps which is how I know it's time to start a new game. Egregious use of copy/pasting and an automated robot production will get you there.
It's still leagues ahead of any other game I've played though.