SANTA CLARA, Calif. -- Even after coach Matt Nagy and the Chicago Bears agreed to a deal with the Oakland Raiders to acquire superstar pass-rusher Khalil Mack, Nagy found himself holding his breath as he waited for the trade to become official.

An already loaded defense adding a player of Mack's caliber brought with it realistic hope for a dramatic one-year turnaround.

"The whole Khalil transaction, that was a long process," Nagy said. "Then, before you know it, he was on an airplane heading here and we're playing the Green Bay Packers in Week 1, so I'm not surprised by the production. I faced him for four years when I was with Kansas City, so I knew what he could do as a player."

Pass-rusher Khalil Mack, who has 12.5 sacks, has helped transform a stellar Bears defense. Photo by Quinn Harris/USA TODAY Sports

In an alternate-but-not-so-far-fetched universe, Mack would be elevating the San Francisco 49ers rather than the Bears when the teams meet on Sunday at Levi's Stadium. If the 49ers had their way, Mack would have been lifting their defense all season, terrorizing quarterbacks and forming a dynamic duo with defensive tackle DeForest Buckner.

As Mack's holdout from the Raiders reached its boiling point over the summer, and it became clear that Mack had no intention of reporting to the Raiders without a lucrative contract extension, the Niners joined the Bears as one of Mack's most serious suitors.

When the Bears finally agreed to a deal with Oakland, they sent a 2019 first-round pick, 2020 first-round pick, 2020 third-round pick and 2019 sixth-round pick in exchange for Mack, a 2020 second-round pick and a conditional 2020 fifth-round pick.

Since then, Niners general manager John Lynch has said that the 49ers actually offered a better package than the Bears.

"I don't want to beat a dead horse, but we tried like heck to acquire Khalil Mack," Lynch told 95.7 The Game radio in late November. "That didn't work out."

While the Niners have not disclosed what, exactly, their offer for Mack was, there are some theories about why the Raiders opted to go with Chicago's offer. In that same radio interview, Lynch said he thought the Raiders didn't want to send Mack to their Bay Area rivals, forcing Oakland to watch him take over games every week for at least one season.

"At times, that leads me to believe, were we ever in consideration?" Lynch said. "I understand the thought of sending him right across the Bay -- I don't know how that factored in. But it is what it is."

Others in the 49ers organization have also suggested that if the Niners were to land Mack, it was going to take an offer substantially better than the next-best bid as a sort of "Bay Area tax."

Some have also theorized that the Raiders looked at the 49ers and the Bears before the season and believed that Chicago's first-round picks would have more value than the Niners'. In hindsight, that clearly isn't the case, and with the 49ers headed toward a top-five pick, it's possible the Raiders missed out on a better offer from the Niners in more ways than one.

On Sunday, the Niners will have to deal with Mack, who has helped Chicago's defense make the leap from a good, solid unit into a dominant one. Mack is tied for sixth in the NFL with 12.5 sacks and tied for first in the league with six forced fumbles. He has added 42 tackles, two fumble recoveries and an interception.

“Khalil is just as good as anyone to ever do it,” 49ers coach Kyle Shanahan said.

Best of NFL Nation • 2,300 miles away? Washington crew is on it

• Colts-Jets trade in 2018 feels one-sided

• Seattle's DK Metcalf on path to stardom

• What's Eli Manning up to right now?

• Cowboys need to find winning ways on road

It's not hard to imagine what kind of effect Mack could have had on the 49ers. For a team that's struggled to finish close games this season, Mack could have helped San Francisco achieve a much better record than its current 4-10 mark, which is why it's hard to play the "what if" game when it comes to which draft picks the Raiders ultimately would have landed.

With two games left in the season, the Niners' search for a difference-making edge rusher will carry into the offseason. They will likely need to spend some valuable draft capital to finally get their guy.

"You never know 100 percent when you're right in the middle of it because there's so many different rumors that fly around," Nagy said. "We were just concerned about what we can control and making sure that we did everything we possibly could to get him and that's what we did. We couldn't control the other teams and what they were doing. We could just control what we could do and that's what happened."

In the end, the 49ers did what they could to obtain Mack. It wasn't enough, meaning the search continues.