In the evening, this happens because the sun must set far enough for the sky to become just dark enough for the very thin crescent to appear. Then, sometimes only minutes later, the moon sets enough to disappear into the hazier lower sky near the horizon. Only once in my life have I had this experience where it could only be seen for a matter of minutes, but it is a striking phenomenon. Sometimes this occurs on the very day of the new moon, and sometimes the day after, depending on the exact conditions. Then, only one day after that, the usual crescent is obvious for everyone to see in a clear sky, and it stays up for about an hour.
Similar magic happens in the morning.
Once I was driving to work and I chanced to see an extremely thin crescent in the eastern morning sky just before sunrise. I stopped the car to get a better look, and when I hunted for it, it had disappeared in the light of the rising sun. One might think he had imagined the sighting if unfamiliar with the moon's motion in the sky. Although trying to see the thin crescent is fun to do, it was much more serious for several ancient peoples because their calendar depended on such observations. An observational lunisolar calendar was used by most ancient people before the solar calendar became popular.