There are a lot of rumours about white spots on your nails being a sign of something serious, like a nutrient deficiency, but the most common cause is nothing to worry about: You just bumped your nail against something. The reason the spots seem to occur so mysteriously is that you don't see them until long after the injury happened. Your nails grow from the base, and if you damage that tissue at the base of your nail, it creates a white spot that you won't see until perhaps weeks later.
Check out the full video from SciShow for more on what those white spots mean and how they're created.
What Are Those Lines on My Nails [SciShow]