I am pretty sure Apple got the idea from the flu.x program which was there first. Apple was very smart to incorporate this feature into IOS. Us peasants that use PCs have to install it ourselves.
Im sure of it. Ive been using f.lux for years, on PCs and on a MacBook Air. You couldnt write an app for iOS because that was getting into stuff iOS didnt want you to have programmatic control of, so Apple pretty much had to include it in iOS.
I may have had a small part in getting Apple to include it. I have a few friends and acquaintances who work at Apple, and I was on them to get it written in. One in particular really saw the UX aspect of it, and may have been a champion for it internally.