SAN FRANCISCO — Juan Perez was in a training room at AT&T Park, getting ready to enter the biggest game of his life, because the Giants — wait, what did they just say? Oscar Taveras? No. Car accident? Noooo…

Perez and Taveras were Dominican kids, which meant they carried both the pride and the burden of playing baseball in that country. Now, suddenly, as Game 5 of the World Series unfolded, there was only one of them.

•DEITSCH: World Series TV guide and media coverage

Oscar Taveras? He was supposed to be the star, stamped with those two words we save for the rarest of prospects: Can’t miss. Before he even moved to the States, his brother Raul told Perez, “My little brother’s gonna be special.” Oscar became one of the most touted prospects in baseball, the jewel of the St. Louis Cardinals’ system.

St. Louis Cardinals rookie outfielder Oscar Taveras dies in car crash

And Juan Perez? Who was he? He went to high school in the Bronx and graduated in 2006. That summer, Major League teams drafted 1,502 players, but nobody took Juan. He went to Western Oklahoma Junior College and hit the holy hell out of the ball. Scouts called him “Mystery Man” because they knew nothing about him.

Perez made it to the majors last year, and when Taveras got called up this season, Juan was so excited to see him, and now … what? Gone? Oscar? Impossible.

Perez checked his phone. Outside, Giants ace Madison Bumgarner was his usual unflappable self, changing speeds, mowing down the Kansas City Royals and wrapping the game up in a nice little package for his teammates. Through two innings, Bumgarner had five strikeouts, and Perez had roughly 20 messages on his phone. Perez saw a picture of the car. He cried. Somebody texted him a picture of Taveras' body, and he finally believed believed Taveras died along with his girlfriend, Edilia Arvelo.

Juan Perez/Twitter

The Giants built a lead, and Perez broke down. He knew they would want him as a defensive replacement in left field, but it took him three innings just to process what happened. Bumgarner kept dealing. Perez had to get ready. Soon, he was in the dugout, but his mind was not. Infielder Joaquin Arias, who dresses next to Perez in the clubhouse, could see Perez was not himself, and he knew why. Arias walked over and told him: Stay strong.

What separates baseball is the sheer relentlessness of it: game after game, night after night, sometimes two in a day, for months on end. Basketball requires greater athleticism. Football is harder on the body. But you need an uncommon level of mental toughness to succeed through the grind of a baseball season, and that’s what Perez took with him to first base as a pinch runner in the bottom of the sixth inning. In the top of the seventh, he caught a line drive. In the top of the eighth, he caught a fly ball.

Then came the bottom of the eighth. The Giants were leading 2-0 with two men on base, and Perez stepped to the plate against Royals reliever Wade Davis, perhaps the most dominant reliever in the world this season. Do you want to talk matchups? Perez hit .170 this year. Righties hit .112 against Davis.

Perez just hoped for something over the middle of the plate; anything else, he just wanted to foul off. He swung and missed once, fouled off two other pitches, worked the count to 3-2. Then Perez demolished a Davis four-seam fastball, hit it so hard that it came within inches of going over the center field fence, for a two-run double. The crowd exploded, all those ticket-holders celebrating their lucky day. From second base, Perez watched the Royals botch a throw home and smartly advanced to third base. When he got there, he looked to the sky and let himself think about Oscar again.

The hit effectively ended the game, but even then, not every Giant understood what it meant. Catcher Buster Posey had heard that Perez was Taveras’ friend. “I can’t imagine what he was dealing with during the game,” he said. But after the game, when I asked first baseman Brandon Belt when he heard about Oscar Taveras, he was confused.

“Oscar Taveras?” he said, and then he seemed to realize if I were asking about a player who wasn’t even in the Series, there had to be a reason, and the reason probably was not good.

“What?” Belt asked, with some urgency. “What happened?”

He died in a car accident.

“That’s awful,” he said. “I don’t even know what to say in times like that.”

In the clubhouse, Perez sat in his uniform pants and a t-shirt, looking at his phone. He tweeted a picture of himself and Oscar, and he turned around for more of the grind: Questions from reporters, some in English and others in Spanish, some about his hit and others about his friend, all in a big pile for him to try to sort out someday.

•TAYLOR: Bumgarner, Giants one win from World Series title

“He [was] a humble guy,” he said of Taveras. “He is going to be missed by a lot of people.”

He swallowed, holding back his emotions. He remembered the night, earlier this month in this very ballpark, when Taveras came to bat in the ninth inning of Game 5 of the National League Championship Series. The bases were loaded and the score was tied with two out. Taveras grounded out to end the inning, and the Giants scored in the bottom of the ninth to end it. The last at-bat of Oscar Taveras’ life helped send Juan Perez to the World Series.

Perez kept talking, patient and composed, the pieces of his friendship coming out in fragments and factoids: “I know his mom, his dad, his brother, we played together in winter ball…”

On the other end of the clubhouse, Giants center fielder Gregor Blanco stood at his clubhouse stall. His placard from Major League Baseball’s Stand Up To Cancer initiative in Game 3 was taped above him, and under the words I STAND UP FOR, Blanco had written MOM and LOVE YOU, MISS YOU. His mother Rosa died of brain cancer eight years ago, at the age of 47. He was 21 at the time, a fringe prospect who had just hit .252 at Double-A Mississippi. Blanco later told the Atlanta Journal Constitution he had a chance to go home and see his mom in Venezuela when she was sick. He stayed in Mississippi and chased his dream. She died the next winter.

In the sixth or seventh inning, Blanco had talked to Perez.

“I told him, ‘I know it’s huge, I know he is a huge friend, but let’s try to focus right now on the game and then we’ll talk about it,’” Blanco said. “I know it’s not easy for him. But he did it. That’s what’s hard about baseball, to do stuff like that … He was able to do it. It was the biggest at-bat of his career. I am so proud of him.”

Did he think Perez could do it?

“That’s why I tried to give him a little bit of positiveness,” Blanco said, as his four-year-old son Gregor Jr. jumped in his arms. “Let’s just go out there and try to play a ballgame.”