Simply put, freckles are just areas of concentrated pigment. We have cells in our skin called melanocytes. They produce melanin. It is the same pigment that colors our hair and eyes. In some people these cells tend to clump together.
Now if we wanted to get our science on, we'd call freckles ephelides. (There are two types of freckles: ephelides and lentigines. This video focuses on ephelides.) I'm going to call them ephelides just because I think the name is kind of pretty.
Anyway, no one is born with ephelides. They develop over time as two things come into play.
The first factor is genetics. We know that at least one gene is responsible for a speckled appearance. We also know that people with light skin and red hair are more likely to get ephelides.
The second key ingredient is sunlight. Exposure to the sun cues the cells to kick into high gear and produce more melanin. The reason is that the pigment both absorbs and reflects the sun's harmful UV rays. This protects our DNA from getting damaged and our skin from getting burned.
The end result is that existing ephelides darken. And new ones pop up. They are a good indication of whether or not you might be getting too much sun. Trust the ginger on this one.