The 18-year-old kid replacing Tony Stewart was no Tony Stewart.

He owned a résumé that included plenty of wins but only one in 19 races of Xfinity Series experience. He joined a team on which the former driver knew what he wanted in a car, and if not, he carried the car on his shoulder with an attitude that won dozens of races and a couple of championships.

“I got humbled pretty quick,” Logano said Sunday after winning the NASCAR Cup Series title. “I guess ‘humbled’ is the word. I don’t know, I got beat up. I got pushed around a lot. I wasn’t fast. I didn’t have no respect. I think that beats up on your confidence pretty quickly, and you have to kind of dig back inside.

“Every sport is a mental sport, so you have to really figure out how to be strong again and dig out of holes.”

The only saving grace during those merciless growing-pain years came in that Xfinity Series, where he won 17 races over four years.

But that Cup Series? Gosh, was that a different story. He had a couple of wins but never finished higher than 16th in points.

Joey Logano, after four years at Joe Gibbs Racing, knew he was out of a ride in 2012, and there was a time he didn’t even know if he would find another seat in the Cup garage.

“I expected to go out there and win … and just got my butt handed to me on a platter,” Logano said. “It was hard. There’s a lot of times that I felt really weak and I’d break down, and it was just hard.

“You know, when you’re confused, you don’t know how to be better. You’re 18 years old or 19 or 20, and this is some pretty big stuff for a teenager to be able to go through, sitting up here, talking to you guys [in the media], trying to handle all those situations. I didn’t know what I was doing.”

He found a new home at Team Penske in 2013, in part just by luck when AJ Allmendinger was fired after failing a NASCAR drug test. And with the new life in his career, he changed. That meek, weak driver? They didn’t see that in the halls at Penske.

“When he walked in at Team Penske, he owned the opportunity,” Logano crew chief Todd Gordon said. “He walked in, and I think Roger [Penske] believed in him, as I did, and I looked at it and said, ‘Here’s a kid who wins more races in the Gibbs Busch cars at the time than Kyle [Busch] did, so he’s capable.’

“He just needed an opportunity. So he came in and believed in himself, and we believed in him, and at that point, he was not weak.”

Just five races into his Penske life, he went face-to-face with that Stewart guy, arms swinging, after Stewart took issue with Logano’s aggressiveness on restarts.

“I’m going to bust his ass,” Stewart said after their confrontation.

Logano didn’t seem all that worried and put it behind him. He won a race that first year and finished eighth in the standings. He then won 11 races over the next two years, learning how to use his bumper when needed to move someone with the hopes of not wrecking them.

“Honestly, I guess I just felt like I’m back to where I was growing up,” Logano said. “As the kid growing up, I was an aggressive racer and I was able to win a lot of races.”

Sure, he made more mistakes along the way. His lack of contrition for previous incidents likely led at least in part to Matt Kenseth’s dumping him at Martinsville in 2015, which eventually eliminated Logano from the playoffs and earned Kenseth a two-week suspension.

In those duels with Kenseth, Logano in some ways changed the rules of the NASCAR playoffs. NASCAR chairman Brian France, to the chagrin of many, called Logano’s roughing up Kenseth for a win at Kansas “quintessential NASCAR,” and it appeared all was fair game.

In that atmosphere, the fearless Logano continued to thrive, and that fearless attitude won him more races, as well as allowed him to handle missing the playoffs entirely last year. As the 2018 season made the turn from summer to fall and Logano saw his cars improve, he combined his aggressiveness with an attitude, a swagger that he rode to the 2018 Cup title.

It seemed appropriate that he won the championship with a strong short-run car at Homestead-Miami Speedway. It rewarded him for doing a lot more taking than giving on restarts. On the restart with 15 laps to go, Logano was in third but really was the favorite.

He didn’t have to worry about Martin Truex Jr. retaliating for their Martinsville dustup as he drove by — once Logano got past Truex, he was too strong for Truex to even get close to make a move.

All those years of getting beat up, all those years of struggles when it appeared he might not win another Cup race, let alone a championship, rode with him in those final 12 laps as he drove to the biggest victory — the 21st of his Cup career — of his 28-year-old life.

“The opportunity to make mistakes is one of the best things that can ever happen to you,” Logano said. “I made a lot of mistakes, a lot of mistakes in front of all of you, things I shouldn’t say or whatever it was, but there’s no regrets, either, because that’s formed me into the man I am today.

“And if it wasn’t for each and every one of those mistakes, I wouldn’t be sitting here today. … God teaches you many lessons, sometimes the hard way. But I wouldn’t take any of them back. Even if we didn’t win today, I wouldn’t.”