Well quite simply mast, Eid is a date in the lunar calender. The phases of the moon as we see them from earth are due to the fact that the moon orbits the earth and that the earth orbits the sun.

We can calcuate the paths of these bodies and therefore know what phase the moon will be in due to relative position to the earth and the sun at any one time.

Hence we know exactly what day Eid will fall in advance. We don't need to 'look out of our window'