Depending on how your Mac was originally set up, if you have set up an Apple ID with it to use, say, with Apple Music, the App Store, Messages, Apple's iCloud services (for synchronizing between multiple devices with Photos, Contacts, Mail, Calendars etc. etc.), but for some reason you logged out (or never logged in) to iCloud or to your Apple ID on this Mac, it will remind you like this to log in to your Apple ID in order to activate those services. Following the prompt and logging in to your Apple ID will make using these services go more smoothly. For instance, if your Apple ID is not logged in, Messages that come in to your iPhone won't be shown in the Mac Messages program. And so forth.
Most people set up their Macs to automatically log in to their Apple ID (and stay logged in) when the Mac is booted but you don't have to, it's more or less a matter of personal preference and convenience.