I currently do not and have never worked for Apple.
I have an Iphone 3G, 3GS and Iphone 4. The 3GS is running the new Iphone OS.
The 3GS does respond differently than the Iphone 4. First, I think that the sensor range is better on the 3GS. I do not know, but it could be the difference between one (Iphone 4) versus two (3GS) sensors. I have tested both and the 3GS (at least mine) responds much better than the new Iphone 4 with the new Iphone OS.
I am sure that the OS can determine what type of Iphone it is running on. It could setup and install slightly different depending upon the version of Iphone. So it would be possible for Apple to have a different response setup for one Iphone type versus another. I asked the Manager at my local Apple store why the Apple support people always recommend reinstalling the OS as a new phone when people have problems. I asked your question (more or less). It is the same OS I stated to her. She explained to me that it is the same OS, but it is setup different on each type of phone that it is installed on. So when a person does a restore from a backup (like from a 3GS to an Iphone 4) the OS is the same, but the settings internally are not. The older settings from the older phone could be restored on the new generation of phone. This could create problems! This answer seemed plausible to me.
I happen to work as an Engineering Manager for a company that designs electronics and software. We use Linux for the OS on our devices and M.S. Windows for the PC side. We design IC chips (some people may call them EEproms) in our devices that tell us what serial number, hardware version and other parameters are in the device. Our firmware (software) running on the device can read these chips and determine what hardware version and etc it is running on. From that point we can make the firmware operate differently on different devices. It is the same firmware (software) that the user installs on each device. We can turn on a feature for one user and turn it off for another. The reason is that an older version of hardware may not electronically support a new feature or etc. Therefore, we have to be able to identify this and deactivate certain functions and etc as may be required. Also, this gives us a way to track the device even if a customer rips off the serial number or etc from the housing.
Apple does the same on the Iphones. Notice how an Iphone always knows the serial number, lifetime call time and certain other information no matter what is done to the phone. Apple uses some similar means to store certain information in their Iphones. So the same OS could install on two different versions of Iphones and function differently. This makes sense to me. That is why I accepted the response I received from the Apple Store Manager.
This is why extensive testing is required on a product. No matter what the real cause of the proximity issue may be. Apple should have found it during their beta testing. Most companies will lock down the hardware and software modifications at some point and shift totally to beta testing and then final release. Once beta testing is started they usually do not make any more modifications in the software or hardware design. The reason is that a slight change could create a huge bug! Also, to do it correctly the beta testing phase has to be repeated again. This would extend the length of time to get a product released to market.
Look at how they may have designed the proximity electronics. The following is total speculation on my part. The actual proximity sensor is most likely IR. It contains a transmitter and a receiver. The signal is transmitted, reflected and the detector measures the signal response. This circuit would create some type of voltage response based upon the amount of signal received. An electronic circuit could be designed to measure this voltage and automatically activate or deactivate the display at some level. A circuit could be designed so that the voltage response could be measured by the software and the software controls the display circuit (on/off). This would be similar to the way the GPS or other sensor in the Iphone work. They are electronic circuits, but the software can receive values from them and react based upon programming. So Apple could have designed this method a couple of different ways (software or hardware).