The IR camera in the remote has a resolution of 1024x768, which is higher than the Wii's display resolution, so it's pixel-perfect. It also knows how far away from the screen you are by how far apart the IR lights on the sensor bar are.
But how does it know the screen size? I have a Wii and have played shooting games with it, never noticed any problems with the aiming. However, I don't know how it would work with different screen sizes (I have a 32'' TV).
My Mario Kart Wii friend code: 2707-1866-0957