It does not.
It merely has a process by which it learns how you say things when you set it up the first time so it can prepare for when you say commands. It's just to help it out, but it does not discriminate between voices. As long as it understands what somebody is saying it will respond and comply.
The only exception to this is when you are addressing Home Pods.
Home Pods can determine which user is asking and can respond for music playback from the speaker's own library if multiple voices are set up.
click here ➜ Set up voice recognition on HomePod or HomePod mini - Apple Support