I have two same dot com domain names but one has got a hyphen…as an example www.myzxyp.com and www.my-zxyp.com. But the one with a hyphen is ranked more than one without. So, what is the main reason for this indifference in ranking?
Content + offsite factors are important for SE. That is not correct to thin SERP will depend on the domain name.
I do not think that because of the domain names. Content is a king for SE
Only the search engine knows the real reason.
Maybe one has some links to it from more authoritative sites/pages, which the other does not?
Content, links, etc… are probably the main reasons.
The other could be that your domain without the hyphen makes another word that isn’t a keyword your targeting. It is hard to say without knowing the domain.
The web pages themselves are what is ranked by the search engines - not their domain names.