This is to make sure you are the appropriate age for that website. Sometimes, a site will feature content that is not for kids, such as profanity. Or, for example, promotional websites for official brands of beer will have you enter your birthdate at the home page, to make sure that you are old enough to look at the beer-related material, since beer is only for people who are 21 or older. If you enter a birthdate that reveals you to be underage, you will be shown a message explaining that you are too young for the website, and your journey will end there. But if your age is appropriate for the material, you will be granted access to the text and images safely contained within the confines of the website.
This is a highly effective method for screening minors, because the calculation of one's age from their truthful birthdate is never wrong. And no one will ever enter a false birthdate, because the text says that you have to put your real one.