MS Exchange on-prem does not include an anti-spam solution. You have to buy one like Symantec security cloud or MS Exchange online security. Exchange is not a 'hosted' solution.
Gmail by contrast is only a hosted/cloud solution, and comes with a security solution as part of the service.
I can compare Symantec Security Cloud sitting in front of an Exchange solution to a Gmail solution, and say that hands down Gmail is far and away better with exactly zero phishing emails making it through compared to numerous attacks able to get through Symantec Security Cloud to our Exchange users.
Comparing Exchange to Gmail is like comparing kwiwis to radishes, in my view.