Scam. Apple will never contact you directly with an unsolicited security message.
See >>> Recognize and avoid phishing messages, phony support calls, and other scams - Apple Support
If you are unsure of the source or provenance of a message or alert, do not respond to, or engage with, the message. Certainly do not, under any circumstances, attempt to contact anyone using the contact details that may have been provided within the message itself. If you need to verify a message from Apple, make independent contact with Apple Support.
Most scam alerts are designed to scare the unwary into giving away sensitive information - or to fool you into doing something that you shouldn’t - usually to defraud you financially.
If you suspect that your AppleID account or Password has been compromised:
If you think your Apple ID has been compromised - Apple Support
In the circumstances, you might be well advised to change your WiFi Passwords. Check you WiFi Router manual for instructions as to how this can changed. After changing your WiFi network password(s), you will need to rejoin your WiFi network using the new Password(s).