How can Apple produce new iPhone 6s if iOS9 is not yet ready
Complete speculation - however...
'beginning mass-production' does not necessarily mean building the first complete, packaged device on that day.  

Presumably different suppliers will start making circuit-boards, adding components, machining the metalwork, glassware, etc etc.

All this may have a lead time of a week to 2 months.

At some point, all the critical components will come together in one place &amp; assembly can begin.
After assembly, then they are then ready to add an OS.

That might only be happening this week, or maybe not even until next week - &amp; iOS 9 is very likely to be ready by the time that happens.
Traditionally, the GM is released to developers within hours of the Keynote speech - which will be next Tuesday, 9th Sept 2015

It's anyone's guess as to how far in advance of that the manufacturers may get it [if at all], but we have to assume that it is sufficiently ahead of time for that gathering stockpile of completed phones to be initted, packaged &amp; shipped in time for the release date; which will be announced on Tuesday.

They've done this before, we have to assume they're well-practised at being able to hit that date, &amp; that the production line is designed to be run on that method.