Sima Yi was a good defender but it is easy to defend when resources of your side are bigger than of attacking side and when attacking side is additionaly limited by logistics issues. But Sima's coup was an act of political genius or close to it.
Indeed Sima Yi could make use of many resources when he was appointed to the Guanzhong Region. He could make use of troops mobilized from across Cao Rui's empire as well as grain which had been stored for decades in the case of such an event. It is notable that even Cao Zhen and Zhang He were able to contain Zhuge Liang. The terrain certainly did not favor Zhuge Liang's invasions, but was also a massive defensive deterrent. Cao Rui was not in a position to conquer Yi Province (Shu Han), nor Jing (Sun Wu), nor Yang (Sun Wu). Which his father Cao Pi had even attempted to conquer Wu and did not even dent them. Obvious Sima Yi wasn't an exception to anything, but that doesn't mean he wasn't a good general.
The Cao Wei Dynasty controlled important positions across their southern frontiers, namely Chencang which controlled one of the passes from Hanzhong, and the central position along the road to Chang'an. It was Chencang upon which Zhuge Liang's campaigns would have hinged. Cao Wei also controlled Xiangyang-Fancheng which prevented Shu Han and then Wu to punch through Jing Province. Then Hefei and Shouchun in the eastern Yangtze which kept Wu at bay for 70 years.
So while it is true that Cao Wei was the more powerful state, with a strong army and larger population. It was also one of the most devastated regions, and lacked the logistics to invade the southern terrain across Hanzhong and across the Yangtze River. That means Cao Wei's front line was the longest and required many reserves to hold against the two rival states. Arguably neither did Shu Han nor Sun Wu have the ability to actually invade the north. At least not until they could overcome major obstacles like Chencang, Xiangyang-Fancheng, or Hefei-Shouchun.
But the fact that Sima Yi used his defensive positions and resources to his advantage, instead of carrying out an incorrect strategy, is indicative of his ability. He could have lost the war in an afternoon but instead refused to budge and played the Shu Han army as the fools. He also had a much longer career than Zhuge Liang and fought against Wu and Liaodong. Even Sun Quan stated that "Sima Yi destroys armies like a god". Zhuge Liang doesn't have much for comparison. It might even be argued that Zhuge Liang's campaigns decimated the military forces of Shu Han. While his incompetent successor, Jiang Wei, destroyed what was left of them, with his repeated defeats at the hands of Guo Huai.
Then we have that incredibly naive Han Xin who was having more than one chance not only to survive to his old age and natural death but also to carve his domain. Naivety is a mild word, stupidity is a better one. In that light all his military achievements become smaller and Sima Yi's bigger. One can't be an ..... in one field and a genius in another, it doesn't work that way. So in my opinion Han Xin was fighting mostly military dilettants in a worn out age.
My main issue with Han Xin is the lack of sources on his career. So we don't know the exact circumstances of many of his campaigns, nor do we have information as to the exact forces which were committed. For example he clearly enjoyed certain advantages during his Guanzhong campaign which Zhuge Liang did not have in a similar scenario. Although he seems to have employed a primarily operational approach in which he divided his army into multiple columns. For example he marched his army through multiple passes, through Hanzhong into Guanzhong.
While overall Zhang Han was unprepared, and this was something that Emperor Cao Rui did not suffer from. That isn't even addressing how many troops were even deployed, and common sense would dictate that this was not even 2 to 1 in favor of Xiang Yu and his allies. I have no sympathy for these underdog fairy tales. That doesn't mean it wasn't an impressive campaign, but it certainly was not an impossible undertaking. Mind you I've scrutinized other generals and their campaigns pretty heavily. In particular Cao Cao, as it is simply untrue that he was severely outnumbered by Yuan Shao. The same goes for like 90% of historical campaigns.
While the other issue is to view Han Xin as exceptional. Well I mean Han Xin wasn't even the only general in history to conquer China, not even the first. He was also not in command of the entire war effort but only one theater at a time. He also never had to face a great power in China, least of all a naval power, which had the ability to shift the power dynamic and prevent unification, as we saw repeatedly from 208 until about the 1800's.
After the 1800's river fleets seem to become redundant for some reason. The south was not a factor until about 208 AD, that is not a coincidence because that was when Sun Quan developed the south by a great amount. Then Jin and many other regimes built on those developments by Sun Quan, and the south became a force to be reckoned with until about 1930. Though it is still the economic heartland of China, and has been for centuries since then.
Han Xin was also not at the forefront of military advancements. No real military reforms that were noticeably different from the Qin Dynasty, no experience fighting on the Steppe or against barbarians, again no experience in the South, no naval campaigns for him to lose. While Xiang Yu's capital at Pengcheng was north of the Yangtze River, so he never had to attempt forcing his way across the Yangtze. Han Xin was a good general but how would he have navigated the Three Kingdoms, or any other period of substantial warfare? It would be like reviving Napoleon in 1940 and telling him to conquer Europe. Or asking Genghis Khan to conquer China in 1570.
About Zhuge Liang: nobody ever considered how hard was for Han to conquer Yunnan also much later after Three kingdoms age and how "easily" he has achieved that. Then also nobody considers that he has been a policy maker, not only an executioner of other people's plans as Cao Cao's generals have been. There is no Cao Cao's general to be even considered comparing to Zhuge, they can be compared to Guan Yu and Wei Yan.
Zhuge Liang is highly overrated. It pains me to say because I actually like Zhuge Liang, but he was extremely minor until Liu Bei had already taken over Yi Province. He was only in administrative roles at that, sometimes militarily adjacent, until Liu Bei died and he was made Chancellor and Regent. At that point he could do pretty much whatever he wanted. But often found himself at odds with one bureaucrat or another.
Zhuge Liang's first commands were when Liu Bei invaded Yi Province, but did not command again until Liu Bei died. Certainly he gave advice, often times good advice, and he was not always heeded by Liu Bei. Moreover during Liu Bei's career he was superseded as a military adviser and planner by Pang Tong and Fa Zheng, as well as others. For example the Hanzhong Campaign had mostly to do with the advice of Fa Zheng.
For the record I do not fault him for not listening to Wei Yan, since Wei Yan was definitely in the wrong. Remember that Cao Zhen later led his own advance through the Ziwu Valley and he was intercepted and defeated by the Shu Han forces. The Ziwu Valley was extremely difficult, even more than the Chencang Valley. In the long run Zhuge Liang's only chance was to take Chencang in the center in order to push onto Chang'an.
During his first campaign Zhuge Liang took the Yangping Pass on the far west onto Wudu, Longshan, Tianshui, and then Jieting. But that was clearly intended to outflank Cao Wei positions along the mountains and to try and take the long way around. That didn't work because Zhang He routed Ma Su. The second campaign went directly on Chencang, that didn't work because the attempt to rapidly move on Chencang through the Chencang Valley created logistical difficulties and the garrison at Chencang simply refused to fall. In the third campaign he retook positions at Yinping and Wudu which had been taken by Guo Huai.
In the fourth campaign he returned to the western flank and tried to push on as in the first campaign. This is when Sima Yi was given command and the result was the stalemate at Mount Qi, in which Zhuge Liang ultimately retreated. The fifth and final campaign was through the Baoxie Valley in which Zhuge Liang tried to position himself between Chencang and Mei. This was clearly an attempt to move east of Chencang and bypass it to march on Chang'an. But the end result was the long stalemate on the Wuzhang Plains and Zhuge Liang succumbed to illness, after which his army was forced to withdraw.
So in that regard he is very similar to Sima Yi since Sima Yi did not command in the field under Cao Cao or Cao Pi. Despite being considered a very skilled administrator and with much military potential. Sima Yi did not command in the field until Cao Rui appointed him. But Zhuge Liang had already been contained by Cao Zhen and Zhang He. When Sima Yi was appointed afterwards that was only the icing on the cake. It is worth pointing out that Emperor Cao Rui himself was intimately involved in these western campaigns. He was clearly a capable individual but had no expertise in military matters.