Phone number validation error

I wonder how phone number validation works. I am trying to submit a form for testing purposes, and I am getting an error. It works fine with real phone numbers, but made-up phone numbers seem to have an issue.

Is there any logic behind phone number validation?

Can this validation cause problems if a user cannot enter a valid phone number they just obtained?

Does this function prevent spam submissions or there is another logic to it?