Yankees had a barren system for quite a long time, had top prospects fail to pan out such as Eric Duncan, Phil Hughes, Joba Chamberlain, Ian Kennedy, and countless others. They had a bunch of aging stars with big money on their MLB roster and had a lot of problems developing their own stars outside of Robinson Cano. It may seem like the "rebuild" happened overnight but eventually the Yankees started making the right signings with international guys, got a few drafts picks right, pulled off some shrewd trades and here they are. Had 3 1st rounders in the Aaron Judge draft, missed on the other two picks. Sanchez was up and down in status as a prospect, had some attitude problems, but in the end he came up to The Show and has been hitting at a historic rate ever since. Severino came up, had a very solid rookie campaign, had an absolutely brutal sophomore season, had to battle to make the rotation last spring and then went on to have a Cy Young caliber year.
Cashman pulled off some shrewd trades, moving Shane Greene for Didi which a lot of fans panned at the time. Traded Justin Wilson for Luis Cessa and Chad Green, which almost everybody hated when it happened. John Ryan Murphy for Aaron Hicks didn't receive too much flak but until last season, people couldn't wait to give up on Hicks and insisted the Yankees/Cashman only gave him such a long rope due to Cashman not wanting to admit his trade was a bust. The Dodgers pulled out of the Chapman trade after his domestic violence charges became known, and the Reds had no choice but to take basically nothing of real value back for him and the Yankees pounced. After a disappointing 2016 season where the Yankees only became sellers at the very end of July after a sweep by the Rays, were fortunate to move their two best relievers for 3 great prospects, one to a team that hadn't won a World Series in over a 100 years and drastically overpaid for a rental - but they won and broke the curse - kudos to them.
A LOT went perfect for the Yankees last season, they were expected to have a couple lean years where they weren't supposed to contend but the emergence of some key pieces changed everything. Judge won the RF job at the very end of ST last year after struggling in his brief stint the year prior to becoming runner up in the MVP race. Who the hell expected that? Severino winning a rotation spot after being miserable starting the year before and turning into one of the best pitchers in the game. Sanchez proving his late 2016 surge wasn't just a mirage.
Had a lot of years where they overachieved but weren't real contenders after winning the World Series in 2009 after their big FA splash of Sabathia, Teixeira, and Burnett. They had to wait until the contracts of Sabathia, Alex Rodriquez, Mark Teixeira, etc all came off the books. Some recent off seasons where the Yankees barely touched the FA market, just biding their time. Finally turned their development process around to produce all these prospects we see currently. It's easy to say the Yankees never had to tank to have seemingly built a potential dynasty like the Cubs or Astros but they still had one of the largest payrolls in baseball and were still treading water. Between having 50 rounds in the draft where just as many "can't miss" prospects missed and fringe prospects turn into above average major leaguers(or better) and the whole international side of things, if the Yankees had to solely depend on the draft they would still be in trouble.
Cashman has done an amazing job the last few years to cement what they already had but the process began long before then, just quietly.