This phenomenon has to do with the actual
structure of our eyes.
There are two types of cells in our eye that let us see. They are called rods and cones and they are located in the retina at the back of the eye. The cones are highly sensitive to color and detail but do not function well in dim light. The rods are extremely sensitive to light but can't pick up very much detail. The rods generally outnumber the cones 10 to 1, except in a small region in the very center of the eye called the fovea, which contains an enormous number of cones. This is why when we read, we usually focus on just a very small area of the page.
Try to read a book by looking at an entire page at once, it's impossible! Unfortunately, the fovea contains almost no rods. So when you look directly at your stars at night, the cones in the fovea can't pick up any light. You have to look slightly to the side so that your eye's rods can see them.