The laws you mention are long-standing, but the trademark system was developed to sort out all border cases that this approach inevitably fails to address. Does it matter if toy cars are orange or green? What if they are toy trucks? Etc etc. Trademark is not compulsory, but it's advantageous in most cases.
Without trademarks, each doubtful claim would require a full run through the courts; and depending on whether you do or don't use Common Law (i.e. in France, Italy, Spain etc), legal precedents wouldn't even hold in most cases, so every single time you'd have to repeat it. That's expensive for everyone involved, including the State.
With trademarks, you have to specify fairly-precise categories at registration, and then there is no dispute. If you file for "BestCars" in "toys", that's it, nobody else gets to make any toy with your name, regardless of whether your cars are red or yellow or even look like a car; if they try, you first threaten them (which will solve 90% of cases right away), then easily slap them in court with a quick process (judge looks at trademark filing, looks at toys, and rules for infringement).
Trademarking works, to be honest. It's one of those things you only ever hear when they fail, which they do, occasionally. In this case we all believe Groupon should have been told "your name is too similar to another in category 021" by an automated system while filing, rather than being allowed to file and wait for a challenge, right? Except companies file trademarks and then they die, and what happens to their trademarks then? Should the state actively scan the business market, going door-to-door telling people "you can't do that because the other guy was doing it first"? That's a huge burden, especially in a global marketplace. It's much more efficient to just timestamp files (which is basically what the office does, by accepting a request) and then deal with the few complaints when they arise -- which they likely will only if the two companies really occupy the same marketplace, incidentally. Believe it or not, most people would rather stand out for originality and won't willingly try to steal someone else's trade name; it's better to just wait for the occasional sociopathic Groupon and then slam it like it deserves (hopefully).