How www vs non-www works
The www at the front of a web address is not decoration and it is not part of the domain name. It is a subdomain — a host label sitting in front of the domain, exactly like shop or blog would. That makes the www version and the bare version two separate hostnames, and everything on the web treats separate hostnames as separate places until one of them redirects to the other.
The bare form is usually called the apex or root domain. Which one you serve is a choice you make once, at DNS and server level: one hostname answers with your site, the other answers with a permanent redirect to it. Neither form has any ranking advantage. Anybody who tells you otherwise is repeating a myth that has been contradicted by search engines for years.
There are two practical differences worth knowing. Cookies set on the apex domain are sent to every subdomain beneath it, which matters if you run a separate shop or app on a subdomain and would rather they did not share. And the apex cannot normally point at another name in DNS, so some content delivery networks need a special record type at the apex, or ask you to use the www form instead.
Why www vs non-www matters
If both hostnames answer with a page, you have two complete copies of the site. Links divide between them, so no single version accumulates the full weight. Analytics may split sessions, cookies set on one host are invisible to the other, and a visitor who logs in on one form can appear logged out on the other.
It also quietly breaks measurement. A Search Console property set up for one hostname reports nothing about the other, so a site can look like it has lost half its impressions when it has simply been reported under the address nobody checked.
Common mistakes with www vs non-www
The first is leaving both live because both load fine in a browser. Nothing looks broken, which is exactly why it survives for years. The second is redirecting in more than one hop — plain to secure on one hostname, then across to the other — when a single rule could send every request straight to its final address.
The third is inconsistency between systems. The site redirects correctly, but the sitemap still lists the other form, or the canonical tags do, or the ad accounts send paid traffic to the version that redirects, adding a hop to every click you have paid for.
How to act on it
Pick the hostname that already carries most of your links and traffic; if it is genuinely a fresh start, either is fine. Set a permanent redirect from the other, and make sure it lands on the final address in one hop rather than passing through an intermediate one.
Then bring everything into line: canonical tags, the XML sitemap, internal links written in content, hreflang, email templates and the final URLs in your advertising accounts. In Search Console, register a domain property, which covers every hostname and both protocols at once, so you are not blind to whichever form you did not choose. Confirm afterwards with a crawl. It sits alongside the choice between HTTP and HTTPS and your canonical tags as basic technical SEO hygiene.