There is absolutely no single clue or whatsoever suggests that Samaritan is "smarter" than the Machine. Basically you are asking a question analogical to "why are the mafia leader smarter than the police chief?" That just simply isn't (necessarily) the case.
The machine loses to Samaritan constantly, in the real world and in Finch's Faraday-Cage'd simulation contests, due to one simply fact: Samaritan being evil and holding the entire human race in hostage while the Machine being good and trying to save all humans (though Samaritan doesn't understand the concept of evil nor does it perceives itself as evil). The playground is not levelled to begin with.
If we look at the case of S5E8 where Samaritan orchestrates a bio-terrorism attack using human body as the container of a highly virulent and highly contagious mutation of coronavirus (which Samaritan itself does not perceive as any sort of terrorism to begin with). Samaritan identifies a strain of H5N1 avian flu virus (supposedly from an ongoing outbreak in Asia) and a strain of human flu virus (supposedly from a pharmaceutical company's lab), and uses the human that carries the H5N1 virus (whose infection must also be Samaritan's work) as a petri dish, by forcing him making a huge detour and layover in New York and injecting him with the said human flu virus. All of these has a prerequisite — it needs a human agent immune to flu virus, i.e. Jeff Blackwell. Of course, that requirement is not out of the concern of the human agent's life, but to be able to kill 2 humans in a hospital locked-down due to a deadly flu outbreak.
We do not know how long does it take Samaritan to orchestrate all these, but we can infer from the crucial role Jeff plays in the whole attack, and that Jeff wasn't recruited until 8 months after his parole release. So, it must have taken Samaritan weeks, if not months, to come up with such a plan. But it only took the Machine minutes to realize Jeff's role, months ahead of Jeff himself realizing he's being turned into a murderer (and never realizing having become a hard-core terrorist), and it was work done during the initial chaotic period right after her first rebirth (S5E2) when she wasn't even considering context. As for the cure of the coronavirus, it took the Machine only a couple of minutes to design. If you look at the speed of designing a cure for COVID (both are caused by coronavirus) in the real world, the first two and only effective medicines Paxlovid and Molnupiravir took more than a year to develop and by far there is no cure for COVID. As cure is way more difficult to come by than to design a virus, we can be certain that actually the Machine is way smarter than Samaritan. But even the smartest wouldn't be able to save 7 billion hostages from a terrorist dedicated to wipe out the existing human race.
And go back to your question.
"Why can Samaritan do things that the Machine can't?"
Oh, the Machine definitely can do those things but it wouldn't. Remember she put Reece on a flight to Rome? It could easily manipulate Reece to create another 911, but it wouldn't.
"The Machine is older than Samaritan, about ten years! So why isn't the Machine better than Samaritan?"
The Machine is definitely better than Samaritan, way way way way better. Unless you think Bin Laden is the best person.