Also, even Yoda eventually realized he had no hope of defeating Sidious, and that Sidious was much stronger than he was.
"Palpatine faced Mace and Agen and Kit and Saesee—four of the greatest swordsmen our Order has ever produced. By himself. Even both of us together wouldn't have a chance."
Obi-Wan Kenobi, Revenge of the Sith novelizatio
It came when the avatar of light resolved into the lineage of the Jedi; when the lineage of the Jedi refined into one single Jedi.
It came when Yoda found himself alone against the dark.
In that lightning-speared tornado of feet and fists and blades and bashing machines, his vision finally pierced the darkness that had clouded the Force.
Finally, he saw the truth.This truth: that he, the avatar of light, Supreme Master of the Jedi Order, the fiercest, most implacable, most devastatingly powerful foe the darkness had ever known...
just-
didn't-
have it.
He'd never had it. He had lost before he started.
He had lost before he was born.
The Sith had changed. The Sith had grown, had adapted, had invested a thousand years' intensive study into every aspect of not only the Force but Jedi lore itself, in preparation for exactly this day. The Sith had remade themselves.
They had become new.
While the Jedi-
The Jedi had spent that same millennium training to refight the last war.
The new Sith could not be destroyed with a lightsaber; they could not be burned away by any torch of the Force. The brighter his light, the darker their shadow. How could one win a war against the dark, when war itself had become the dark's own weapon?
Revenge of the Sith novelizatio
Inside the spacious interior of the Galactic Senate chamber, Yoda challenged the Emperor. The two engaged in a spectacular duel—a contest between the most powerful practitioners of the Force's Light and Dark Sides. The Emperor proved too powerful to defeat. Although Yoda held his own for much of the duel, in the end the Sith bested him. He realized that continuing to directly confront Palpatine would mean failure. Defeated, Yoda slunk away into the shadow's of the Senate chamber's cavernous depths, leaping into a waiting getaway speeder piloted by Bail Organa.
The Complete Star Wars Encyclopedia
Yoda went after Palpatine in the empty Senate chamber, but could not defeat the most powerful Sith Lord in history.
The New Essential Chronology
Yoda confronted Sidious in the heart of the Senate chambers. This erupted into an intense duel between these masters of the Force, a fight that Yoda ultimately lost and was forced to flee.
Databank: Yoda
Master Yoda made a last-ditch attempt to stop him, and their fight spilled over into the now-empty Senate rotunda. Darth Sidious overwhelmed Master Yoda with the destructive energy of the dark side, and the Jedi Master fled Coruscant.
Databank: Emperor Palpatine/Darth Sidious
The Jedi Master and the Sith Lord dueled in the Senate chamber, but Sidious was too strong for Yoda to defeat.
Coruscant History Gallery
Even the greatest warriors of the Jedi - Mace Windu, Kit Fisto, even Yoda - could not defeat the Sith.
The Last of the Jedi: Underworld
Not saying that Yoda isn't 4-B. Just that even he is not the equal of Sidious.