When the San Francisco 49ers pried quarterback Jimmy Garoppolo, then the presumed successor to Tom Brady in New England, away from the Patriots in a stunning trade-deadline deal two years ago, it was easy to envision Coach Kyle Shanahan and General Manager John Lynch’s rebuilding project having splendid results.

That gave Shanahan and Lynch the prospective franchise quarterback they needed to turn things around and begin trying to recapture the franchise’s glorious past.

Two years later, the 49ers indeed are on a roll. They are the NFC’s only unbeaten team, taking a record of 6-0 into Sunday’s home game against the Carolina Panthers. They’re coming off a satisfying victory at FedEx Field that allowed Shanahan to award a game ball to his father, Mike, and exact some family revenge against the Washington Redskins. And Lynch bolstered the roster Tuesday by trading for Denver Broncos wide receiver Emmanuel Sanders.

But it’s not a straight line from the Garoppolo trade in October 2017 to today. The 49ers endured a miserable 2018 season without Garoppolo, who was lost to a knee injury after three games. And even now, they are not winning because of Garoppolo; his numbers are rather ordinary. The 49ers are winning because they’re a deep and versatile team led by an overpowering defense.

“When you have a D-line like that and linebackers and our secondary that make plays, you have that out there, you definitely feel good,” tight end George Kittle said after last Sunday’s 9-0 triumph over the Redskins. “The best part is, they just get you fired up, no matter what. If we’re losing or we’re winning, it’s like, ‘Hey, our defense did this, and we’ve got to give them some help.’ And it’s awesome.”

The 49ers and Patriots are the NFL’s only undefeated teams. If they meet in the Super Bowl, the story line will be Brady vs. Garoppolo, his former understudy. But both teams are trying to find their way on offense while their dominant defenses do the heavy lifting. The 49ers are first in the league in pass defense and second, behind the Patriots, in total defense and scoring defense.

“Guys are just owning their jobs,” defensive tackle DeForest Buckner said. “They’re not pointing any fingers when things go wrong. They come on the sideline and see what’s going wrong. Everybody’s seeing what we can do better to help the [defense], and we’re just feeding off each other’s energy.”

It’s not that the 49ers are terrible on offense. Shanahan is considered one of the league’s top offensive designers. The 49ers are second in the NFL in rushing offense, seventh in total offense and 11th in scoring. And Kittle is one of the league’s top tight ends.

But it’s also clear that if the 49ers are going to meet the now-raised expectations in a season suddenly full of possibilities, they’ll need more from Garoppolo. He has six interceptions to go with seven touchdown passes, and he has an okay, but far from dazzling, passer rating of 90.8 that ranks 21st in the league.

That is not a sentiment that is voiced in the locker room, though: 49ers players express support for their quarterback. Cornerback Richard Sherman said Garoppolo made the plays that needed to be made, whether they were reflected in the stats or not, in rainy conditions against the Redskins. Kittle said Garoppolo is the team’s leader.

“The leadership that he carries and the voice that he has both on the sideline and in the huddle, it’s incredible,” Kittle said. “He’s what makes our team click. He’s our leader. And to have someone like that who kind of carries the team, whether he’s throwing for how many yards or rushing for how many yards, his voice takes us a long way.”

Garoppolo certainly was missed last season as the 49ers finished 4-12. That left them 10-22 over two seasons with Shanahan and Lynch in charge. With Garoppolo back, the pieces are in place. The trade for Sanders, who had 1,000-yard receiving seasons for the Broncos in 2014, 2015 and 2016, should help the passing game. The confidence and resolve don’t require further boosting.

“We have that focus,” Kittle said. “We have that will, and we have that grit. And I love that about this team.”

When the mood needs to be lightened, Kittle said, he will joke with Garoppolo to get the quarterback agitated, sometimes by pretending not to understand the play-call in the huddle.

“I just try to act dumb all the time to him so he has to repeat it,” Kittle said. “And I’m like: ‘No, I’m good. I’m kidding. I actually got it.’ Football is a lot easier when you’re having fun. If it’s too serious, I don’t really like that.”

The 49ers clearly are enjoying their success. Shanahan, the former Redskins assistant who was ousted when his father’s head coaching tenure with the team came to an acrimonious end after the 2013 season, savored Sunday’s win even though his dad wasn’t in attendance. And 49ers players followed a game-ending sack by rookie defensive end Nick Bosa by celebrating with belly-flop slides across the soggy turf.

But Sherman also said he trusts Kyle Shanahan and defensive coordinator Robert Saleh to keep the celebrations in check and remind players that there are bigger things to accomplish.

“Nobody’s looking ahead,” Sherman said. “Nobody’s like, ‘Man, I can’t wait to play such and such.’ Or, ‘I can’t wait until we get here.’ … I think guys have the right mentality on this team to just stay locked in, stay in the moment, stay in the present. Don’t look too far ahead. Don’t look too far back. Don’t say, ‘Man, it feels good to be like this,’ because I think the moment you take an exhale and say, ‘Ah, man, this feels good,’ is when you get hit in the mouth and you take a step back. And I don’t think anybody’s doing that.”

More NFL coverage: