People talk about mouse functionality, I'm almost completely sure the IR ray is to be reflected and will travel to the top of the joycon, so it can be used as an IR pointer, just like did with the Wii, it will be used with that purpose including Wii NSO games.
The console was rumored to have a camera, I'm pretty sure Nintendo doesn't want to deal with privacy concerns and controversies so it might be an IR camera designed to catch the IR ray coming from the joycons so it can calculate it's relative position.
Both joycons have IR emitter as per the teaser BTW.
So the way I imagine it works is like the Wii did but inverted, instead of each controller sensing the TV position through an IR bar below the TV and send the data to the console like the Wii did, it's the console itself the one "seeing" the IR rays and calculating the relative controllers positions, so no need of extra hardware (the IR bar like the Wii).
That's my idea so far, not sure if it makes sense tho.