You would be surprised. I heard an excellent talk back in the mid-90's by a DEC engineer, one of the Alpha architects, about how they had instrumented Windows NT to do some performance analysis. Even though DEC was working very closely with MS they did not have access to the source code. They developed instrumentation that didn't require the source and they had this great analysis of how locking was working inside the Windows NT kernel.
One of the issues they found (at that time) was that Windows did not scale well on multi-processors. If I remember right, the practical limit was something like 4, but it could have been lower. They did a lot of the benchmarking using SQL Server and then took the results back to MS and presented them to both the SQL Server team and the NT team (together, in the same room).
According to their instrumentation, the bottleneck was a single lock, that the kernel would grab all the time for some reason. He said the SQL Server guys and NT guys started yelling at each other about the pros and cons of this lock, which was known internally to MS as "Dave's Lock" (Dave Cutler).
So, anyhow, the point is that you can reverse engineer to discover what is going on in the system and you don't need the source code. Of course, it's a lot of work.