On a hardware standpoint, how does the hard drive/wifi light know when data is being transfered? Does it know when data is being read/written because of the pulses in the wire when the data is being transferred? Does the light blink only when it is being written, being read, both, does it not know/care?
Usually the LED blinks when data is either being sent or received. From the manual of an ASUS P5K motherboard, for example:
The chipset/hard drive controller/wireless chip knows when data is being transferred, and turns the LED on/off accordingly.