To an extent it was luck, because he had BB on the team for a single year and developed a gut feeling over him through their personal relationship and first hand knowledge of how players thought of him, in a way that's not wholly dissimilar to what happened with Mayo. Sure, Bill had an incomparably more extensive and successful resume at that point, but he wasn't seen as a guy who turned the Browns around, but as a failed HC with a difficult personality. Kraft was supremely ballsy to bet on Bill to the extent that he'd trade a first round pick for him, but he developed confidence in Belichick's ability to thrive as the next head coach through instinct and limited information. Bill was "his guy", it's not like they had a whole process and he came out of it as the candidate who checked the most boxes. It's not right to call it exclusively luck, I agree, but I don't think it demonstrates some higher level of planning or reasoning by Kraft either. He got to know Bill for a bit, he liked Bill personally, defenders praised Bill, once Bill became available he was set on having Bill as the next guy. That's pretty much it.
I think there is a lot missing with this.
BB had a defensive game plan from the 1990 Super Bowl that is in the Hall of Fame - as well as being the right hand man behind a HOF coach in Bill Parcells. He'd rebuilt the Browns into a playoff team, only to see it fall apart after the team announced a move. He had built a defense in NE, working for Kraft, that had gone to the 96 Super Bowl, and had players like Lawyer Milloy raving about the guy. There was not "limited information".
The issues with BB as a head coach was a media that didn't like him and Art Modell saying he would be a terrible mistake. I guess you could add the handling of the Bernie Kosar situation, but BB was right (and would likely use that experience several years later to build a dynasty) So Kraft had to reconcile a brilliant, successful football brain with considerable success as a coordinator and limited success as a head coach, who had been fired as a head coach under unusual circumstances. There was nothing that Kraft could do besides size him up one on one and determine where the truth lay. And he sized it up perfectly.
Mayo on the other hand served as a business development professional for several years before never calling a play as a defensive assistant for a bunch of Patriot teams that never won a playoff game. Not sure the vetting process for these two should have been the same.
Yes, the fact that a gamble was involved in both is certainly in common, but that's just the risk inherent in finding a coach. Sometimes the unusual hires work out and they are John Harbaugh (ST coach) or Dan Campbell, sometimes you get Nathanial Hackett.
Sometimes you hire a brilliant technical mind and get Kyle Shanahan or Sean McVay and sometimes you get Josh McDaniels. Obviously it isn't an exact science and by no means should it be treated like BB was a shoo-in, especially with the compensation necessary, but the comparison is IMO inappropriate.