The stars are always there, we just can't see them with the brightness of the sun present. It's like those glow in the dark stars/planets you had as a kid. The lights had to be out to see them in contrast to the dark. Otherwise they didn't appear to be shining. It's all an illusion/limitation of our human visual system.