Darkvision states:
You can see in dim light within 60 feet of you as if it were bright light, and in darkness as if it were dim light. You can’t discern color in darkness, only shades of gray.
It doesn't rely on light to function, as it grants you vision in total darkness. Expanding on Adam's answerAdam's answer, I would say that darkvision has effects like modern active-infrared night vision:
This image was shot using only infrared light. There are light differences and projected shadows, although the general depth perception is not great.
So yeah, you actually project infrared rays from your eyes. How cool is that xD
On the other hand, Devil's Sight states that you can see normally. Normally includes colors and everything, so I think it's more a magical trait that relies on a reality-twisting effect like most spells or monster traits do (eg: beholder levitation).