Cockatiels will tap their beaks on a window if they notice a threat outside the window or to ascertain dominance over the cage. If the tapping is continuous, the cockatiel is warning you to stay away. Also, it could be that the cockatiel is trying to communicate with its reflection in the window.