Smartphones know when you're tired because they have sensors that can tell how much light is coming into your roomand whether your phone is moving. When the light gets dark and the phone stays still, it thinks you might be sleeping, just like a nightlight knows when to turn on.