Even in a dress-down gray sweater, Bob Iger looks a bit mechanical. His mouth is almost geometrically straight, his face constructed of some cool alloy. His hair, of course, is perfect. That he can remain so mirthless even while wearing red-rimmed 3-D glasses and a fedora bedecked with tiny blinking lights is something of an achievement. Slowly he steps into the Dish, a windowless virtual reality chamber with curved walls at Disney’s Imagineering labs, a short drive from his office in Burbank, Calif.  He is now in a forest—with cartoonish, lush green trees and brightly colored flowers, each comprising millions of floating pixels. All of a sudden, Iger stops and pretends to lean against one of the virtual trees on his path. A row of spectators off to the side—who include several members of his management team and some of the technologists who created the three-dimensional woodland—erupt in relieved laughter. Iger is having fun.

The Dish, primarily used as a testing site for future rides and experiences, is the first stop during a two-hour tour of the latest and greatest tech in the works at the company’s theme parks. Though Iger, the chief executive officer of the Walt Disney Co. DIS , is a frequent voyeur at Imagineering, today is a special visit. Each year the chemical engineers, software developers, and roboticists in this particular research division—one of five at the company—have an opportunity to formally present their wildest (and, with any luck, economically viable) innovations to the boss.

CEO Bob Iger seen with Millennium Falcon which will be in the 2015 released Star Wars movie.
Photograph of Bob Iger, CEO of Disney taken for Fortune in NY. Scene with Millennium Falcon in Pinewoods Studio, Buckinghamshire, England, is a composite image created by Industrial Light & Magic for Fortune.Photograph by Wesley Mann for Fortune. Composite scene created by Industrial Light & Magic for Fortune

The 10,000-cubic-foot virtual reality room, recently upgraded to incorporate the latest graphics and audio equipment, is a good start. Behind the scenes, a system of superfast networked computers updates the 3-D scenery 60 times per second so that each time Iger moves his head, his perspective of the trees is altered. High-resolution projectors, meanwhile, beam millions of pixels onto the 14-foot-high walls, whose corners have been rounded to make the experience more immersive (most VR rooms have flat walls with sharp corners). The technology is still too expensive and cumbersome to work in an environment like Walt Disney World Resort—imagine how long the line would be for a ride that takes just one person at a time—but someday soon, virtual forests could be coming to a park near you.

This kind of “blue sky” experimentation has always been part of Disney’s ethos, going back to the days of multiplane cameras (to add visual depth to the background in the 1937 film Snow White and the Seven Dwarfs) and early use of lifelike robots (Disneyland’s Enchanted Tiki Room, which features electromechanical singing birds, pioneered the concept in 1963). But more than six decades ago, when founder Walt Disney first created Imagineering as the company’s innovative arm, virtual reality chambers were almost as far-fetched as talking animals.

Fast-forward to today, and not only is virtual reality an actual reality, but the flirtation between technology and entertainment has evolved into an insoluble—albeit sometimes contentious—marriage. From Netflix to YouTube, consumers have more digitally distributed content to choose from than ever before. People everywhere are more connected and more mobile, and are demanding more get-it-now services like Amazon Prime and Google Express—all of which make standing in line, even for a roller coaster, feel like a waste of time.

Iger helped Disney get a headstart on those trends by making big and early bets on new technologies, even some that were seemingly at odds with the company’s business model. One of his first orders of business when he took the top job in 2005 was to put episodes from the television hits Lost and Desperate Housewives, both of which aired on the company’s ABC network, on iTunes. It was the first deal of its kind. The following year he broke ground by offering free full-length TV shows online (in addition to ABC, Disney owns ESPN, Pixar, Marvel Entertainment, and Lucasfilm). More recently he has invested in everything from RFID-enabled wristbands at Disney World to interactive mobile apps to movies that are shot by drones.

Indeed, it’s hard to point to one major franchise at Disney that isn’t being shaped, or reshaped, by some inventive new technology. Take the runaway 2013 hit Frozen, where animators created thousands of individual snow particles and then designed algorithms to instruct each flake how to combine with any other, or flutter in the wind, or fall off a hurtling snowball—making every winterscape in the movie feel that much more real. “There are a lot of companies that focus on content and lot of companies that focus on technology, but I think Disney is one of a few companies that do both equally,” says Sheryl Sandberg, chief operating officer of Facebook FB and a member of Disney’s board of directors since 2010.

Iger surrounds himself with people who are steeped in both worlds, but he has made a deliberate decision not to have a chief technology officer. In fact, he’s the closest thing the company has to a central head of tech. And while there are many lessons to learn from the way he has run Disney over the past decade, this one is right up there: Not only do today’s media companies need to start thinking like technology companies—their CEOs also need to start thinking like CTOs.

That mindset has served the company well. In November, Disney announced its fourth consecutive year of record revenue, raking in an annual $48.8 billion in sales, an 8% increase over the year before. Under his watch, the company has delivered a total shareholder return of 341%, compared with 104% for the S&P 500. The brands he has spent billions snapping up appear to be paying off: Two of the five biggest movies in 2014 were made by Marvel Entertainment, which Disney acquired in 2009. And Frozen, the highest-grossing animated film of all time, is still printing money for the company. Meanwhile Disney’s investment in MagicBands, RFID-enabled wristbands that let visitors gain admission to the parks and buy merchandise, is starting to pay off: Guests who use them are spending more on average (Disney won’t say how much more).

Not all of Iger’s bets have reaped rewards—it took the company’s gaming division five years to get out of the red—but he’s had enough big successes that this past October, Disney’s board renewed his contract through 2018. (The 63-year-old Iger was originally slated to retire next year.) The extension means that Iger will get to see whether one of his biggest bets will bear fruit: Late this year the first Star Wars movie since Disney acquired George Lucas’s film empire in 2012, The Force Awakens, will hit theaters.

Between now and then, the CEO has a Millennium Falcon–size to-do list—including picking a successor and a likely major corporate restructuring. (There is speculation that he’ll fold Disney’s interactive unit into the consumer products group.) Later this year the first theme park in China—a $5.5 billion investment—will open to the public, testing Iger’s ability to grow the company on a global scale. And although he was quick to experiment with iTunes, he has yet to find the ideal digital distribution model for content that ranges from live events on ESPN to new movie releases. If there’s one constant about technology, it’s that it’s constantly changing. More than ever, success for any mediatainment mogul comes down to knowing which platforms and gizmos to bet on—and when.

When I first meet Iger on a late October morning, he’s standing over his office desk, eyes glued to a video streaming on his laptop. In his hand is a dormant iPad. Good Morning America is playing on a large TV screen across the room.

“I’m multitasking,” says Iger, a former upstate New York weatherman who began his career at ABC in 1974 and who now leads the world’s most valuable media company and its 180,000 employees. Known for his 4:30 a.m. workouts and obsessive punctuality, Iger is an involved yet hands-off manager, say dozens of company insiders and former employees interviewed for this story.

He wasn’t the obvious pick for the job, at least from the outside. Former Disney CEO Michael Eisner is credited with reviving a flailing Disney back in the 1980s, but he was also criticized for his reluctance to publicly name a successor—as well as his penchant for feuding with other power players. In early 2005—following a period marked by a hostile takeover attempt and battles with shareholders and former board members (including Roy E. Disney, the son and nephew of the company’s two founders)—it was announced that Eisner would leave the Mouse House a full year before his contract expired. Behind the scenes the board had hired a recruiting firm and looked at several possible replacements, including a handful of external candidates and one internal exec: Iger. Though Iger’s role in the company—chief operating officer—would seem to have made him a natural candidate for the top job, he had to spend months pitching his vision for change to the board (at its core, Iger’s strategy had three “pillars”: investing in creative content, international expansion, and technological innovation). The hard sell worked. In October 2005, Iger moved into the sweeping CEO suite on the sixth floor of the “Team Disney” building in Burbank, situated on a 51-acre studio lot.

Immediately he made a series of bold changes, including shifting the decision-making power away from a central strategic planning division toward the individual business units. The change enabled each division to devise its own strategy. Instead of having one corporate chief technology officer to oversee all the business groups—a role that he would ultimately play himself—he appointed a CTO for each.

“It gives the businesses the ability to experiment and try even if they fail on some of the things that they do, without a corporate watchdog looking over their shoulder all the time,” says Iger.

Every few months the CTOs of Disney’s respective businesses meet—at ESPN headquarters in Bristol, Conn., or at the company’s development center in Seattle, or at another locale—to discuss challenges and share information. Over the past couple of years the CTO council has launched “hackathons” and convened a “Best of Disney” annual symposium in which 50 new innovations are on display for the whole company to view. They’ve also partnered on technology initiatives like creating a single user ID that customers can use with various digital products. More recently they’ve started strategizing ways to incorporate drones into Disney’s businesses, such as flying them over football games with high-resolution cameras. Last summer the company filed a series of drone-related patent applications. (Eighty-four percent of Disney’s active patents were filed during Iger’s tenure as CEO.)

A team of imagineers check out the ultimate virtual reality machine at Disney's Burbank headquarters: the Dish
A team of imagineers check out the ultimate virtual reality machine at Disney’s Burbank headquarters: the DishCourtesy of The Walt Disney Company

“We’re trying to anticipate the future so that when the technology is there, we’re ready,” says Vince Roberts, CTO of ABC Television group. The council helps drive much of the digital experimentation that takes place at the company. In the end, the big bets remain Iger’s call—though he’s got plenty of geek brainpower on the Disney board to backstop those decisions. Twitter and Square co-founder Jack Dorsey was added to the board in late 2013, joining Sandberg, BlackBerry CEO John Chen, and others.

“Disney has always been about building technologies, not just applying technologies,” says Dorsey. “But I think Bob is rekindling that relationship with technology in a way Disney hasn’t seen for some time.”

Through the CTO council and the Silicon Valley DNA that’s been mixed into the company’s board, Iger has surrounded himself with enough know-how to birth numerous start-ups. But if there is one particular relationship that has most shaped his thinking, it’s the six-year friendship he had with another CEO: the late Steve Jobs.

The heart of Pixar’s campus in sleepy Emeryville, Calif., is a bright, open atrium with life-size characters from the Monsters, Inc., Cars, and Toy Story movie franchises. About 700 animators, production managers, and developers eat, work, and play in the building, designed by Jobs, who started the animation company with John Lasseter and Ed Catmull in 1986.

A few steps from the second-floor office where Jobs used to work, Catmull reminisces about the long, strange relationship between Pixar (which was spun out of George Lucas’s film company) and Disney. In 1984, when Eisner took over the latter company, Disney’s animation division was on the verge of collapse. Eisner got to work. He doubled its production of movies and formed a partnership with Pixar, then a fledgling startup that had yet to make an animated feature film. As part of the deal, Disney co-developed a computer animation system with Pixar and later also agreed to market and distribute movies the smaller studio would create, taking a cut of the profits.

But even as Pixar churned out hit after hit—from Toy Story to Finding Nemo—the relationship with Disney frayed. Part of this was due to artistic differences. A bigger reason, say sources, was that Eisner and Jobs did not get along.

According to co-founder Catmull, Disney—under Eisner—had formed a group called Circle 7, which was dedicated to creating a sequel to Pixar’s popular Toy Story film. At the time, Pixar had made seven movies, and Catmull, Lasseter, and Jobs were convinced Disney was trying to thumb its much larger nose at their small but successful studio.

“We were up here thinking it’s already offensive that they’re making our sequels—calling it Circle 7 is just rubbing it in our faces,” says Catmull.

It turned out that the group had been named after its building’s address. But the damage had already been done, and the partnership between the two companies began to unwind.

Eisner declined to speak to Fortune on the record for this story, but a source close to Eisner maintains that there was no bad blood between the former Disney CEO and Jobs; the two men, he says, simply could not come to an agreement when it came to renewing the Pixar deal.

One thing, however, seems crystal clear: The relationship between the two companies took a different turn in 2005, when Iger was handed the reins. Even before the news became public, he called Jobs to let him know big changes were coming. “I told him I was well aware of how strained the relationship had become,” says Iger. “I said, ‘I know you think it’s going to be business as usual, but I’d like to prove to you that it’s not.’ ”

Jobs gave Iger the benefit of the doubt and told him to come up as soon as the dust settled. And that’s just what Iger did—not only because he knew Pixar was the key to revitalizing Disney’s lifeless animation studio, but also because he saw Apple’s CEO as a valuable technology partner. The sentiment, apparently, was reciprocated.

“Steve recognized that in Bob he actually had a partner,” says Catmull. “In the subsequent years they thought of each other as true partners. That’s what he wanted, and that’s not what he had previously.”

Iger soon had an opportunity to prove to Jobs just how committed he was to the Disney-Apple alliance. After just a few days on the job, Iger flew up to Apple AAPL headquarters in Cupertino and personally hammered out a deal to put Disney content on the then-nascent iTunes platform.

In October 2005, less than two weeks after officially taking on the CEO role, Iger stood on a Bay Area stage with Jobs at the much-anticipated unveiling of the video iPod and announced that ABC shows would be available on the device maker’s iTunes store, which at the time sold only music. It had taken the two CEOs less than a week to negotiate the deal. But the effects were far-reaching and long-lasting.

“We got backlash from everybody—from affiliates, retailers, and the guilds,” recalls Iger. “But it changed my relationship with him [Jobs] bigtime. And it led to a much better dialogue on Pixar.”

In early 2006, Disney announced it was buying Pixar for $7.4 billion. As part of the deal, Catmull and Lasseter took over all of Disney’s animation division. Jobs, the majority shareholder in Pixar, became Disney’s largest shareholder (a status his widow, Laurene Powell Jobs, still holds). Before he died in 2011, Jobs requested that Iger replace him on the Apple board once he was gone—a position the CEO of Disney holds to this day.

“Occasionally we would stand in front of a whiteboard and talk about ideas,” says Iger. “We’d just muse on business. When you think about it, media’s the intersection of content and technology—it’s all about storytelling, like photography and the camera. So we’d talk about that a lot, the intersection between the story and the gadget.”

The partnership between Disney and Apple has only deepened over the years, even after Jobs’ death. Disney was one of the first media companies to develop apps for iPhones and iPads. Apple Pay, the device maker’s new mobile-payment system, recently rolled out across Disney stores, and a Mickey Mouse–branded Apple “smart” watch is expected to launch early this year.

“He has the courage to lose sight of the shore,” Apple’s current CEO, Tim Cook, says of Iger. “He understands the tradition of Disney but isn’t wedded to it.”

After Pixar, Iger didn’t shy away from other large-scale acquisitions. In 2009 he shelled out $4.3 billion to buy Marvel. Three years later he snapped up Lucasfilm for $4 billion. As part of the deal, Disney inherited Industrial Light & Magic (ILM), the special-effects unit of Lucasfilm, and several hundred additional technical minds. All the brands—from the TV side to the parks to movies—are now encouraged to “beg, borrow, and steal” when it comes to technologies. (ILM, for example, is advising Pixar on how to animate lifelike tusks for a project currently in production.)

With Lucasfilm and ILM—and Pixar and Marvel—Iger has brought multiple cash cows into the Disney fold, not to mention supplemented his arsenal of frontier tech. But the true upside of this intermingling of innovation centers isn’t something that translates simply to a P&L, says ILM’s president, Lynwen Brennan. The more substantive change, dare we say, is to that squishy buzz-concept known as corporate culture. Disney is different these days. “Synergy” actually means something here, says Brennan. “They’re very supportive of us pushing new avenues and new ways to think about things.”

DISa-01.15

Which is not to say that culture conquers all. There’s also the matter of selling something people want to buy. And that wasn’t the case at one of Disney’s key business segments for a while.

Until last year the company’s interactive division, responsible for games and websites, had been in the red for five years, losing more than $1 billion. “We were too big and trying to do too many things,” says Jimmy Pitaro, who oversees the unit. It also suffered from a kind of corporate neglect, say insiders. The interactive unit “did not have a great track record of moving the stock price, and therefore it did not have as much influence and didn’t necessarily attract the greatest talent in the company,” says one former exec.

After a round of layoffs and reorgs, the division finally managed to get its footing in 2014. Outdated product lines—like console games—were nixed, and Disney poured $100 million into Infinity, an interactive game that transports physical toys into an online world. Instead of trying to do it all themselves, Disney sparked large licensing agreements with outside developers such as Line, a Japanese company that developed a mobile game based on Tsum Tsum—plush, circular stuffed animals that vaguely resemble infantile versions of traditional Disney characters like Donald Duck and Goofy. The toys, which also function as screen cleaners, have been a huge hit in Japan, where 2.8 million Tsum Tsums have been sold since early last year. More important, the accompanying mobile game has gone viral, reaching the No. 1 app spot on both iOS and Android in Japan, where it has been downloaded more than 21 million times.

Last year was the first time Disney’s interactive unit turned a profit since it started operating independently in 2008, earning a modest $116 million on some $1.3 billion in sales.

“If you’re going to win big, you have to get in early,” says Iger. “If you get in late, the marketplace is so dynamic and the technology’s changing so much that oftentimes you make an investment in something that you’ve witnessed working, but it’s on the cusp on vast change. We lost a fair amount of money in the process, but we learned from that.”

But the division has yet to make a name for itself as a leader, not just a fast follower. Buying up Minecraft owner Mojang, for example, could have been a bold step toward increased relevancy. (It’s too late now—Microsoft snapped up the gaming company for a cool $2.5 billion in September.) Indeed, it now looks as if Disney’s interactive unit will be absorbed by a larger division—the consumer products group, which likewise develops connected toys, tablet games, and other techie products.

One of the biggest current debates in the TV industry is how to sell premium content—once available only as part of pricey cable bundles—directly to consumers. While Disney gets a lot of attention for its parks and movies, its biggest and most profitable business is actually the media networks division, which includes ESPN and ABC. (For that, it has Eisner to thank—the former CEO acquired both channels in 1996.) Now, as an increasing number of viewers turn to streaming services that they can watch whenever and wherever they want, Disney finds itself under pressure to offer more content in an unbundled format. Competitors like HBO and CBS have already announced plans to do so, which are likely to unleash a Pandora’s box of à la carte content.

Last February, Disney rolled out an app, called Disney Movies Anywhere, through which the company sells copies of its movies direct to consumers. Iger has also partnered with the likes of Netflix to create online-only shows. And last May the CEO acquired YouTube network Maker Studios for $500 million, upping his wager on digital-only distribution.

But it’s ESPN that will be the toughest nut to crack—and quite possibly Iger’s greatest opportunity to leapfrog the competition. Live sports content, particularly ESPN’s many channels, is one of the top reasons many consumers still pay for cable bundles. (The flagship channel alone reaches 95 million homes.) That kind of brand value means fans are likely to remain loyal to the network whether it’s offered 24/7 through Comcast or piecemeal and direct to consumers. It’s expected that ESPN will test the waters with an unbundled digital subscription service that will stream the Cricket World Cup later this year (the company won’t confirm any specifics but reports it’s in negotiations). At the same time, there is no proof that Disney can make enough money distributing live sports content à la carte, and Iger is careful to temper any experimentation with a stated commitment to “the bundle.”

“It’s still clearly the dominant entertainment or television package in the home,” Iger said on a call with investors last November. “And we think that’s going to continue [for the] foreseeable future.”

Some analysts agree. “I’m not trying to be a dinosaur, but I think ESPN is a critical part of the bundle, and most of the major media companies will continue to support paid TV,” says Jessica Reif Cohen, a veteran media analyst at Bank of America Merrill Lynch. “The bundle still makes the most sense from a pricing perspective.”

Certainly Iger and his lieutenants have spent a fair number of brain-hours trying to solve that pricing calculus. But talk to the man at any length, and it’s apparent he’s got a still more elusive challenge on the mind: wooing the itinerant, drifting crowd. Iger spouts off terms like “customer experience” with some frequency. And as with everything else on his management agenda, he intends to tighten Disney’s relationship with the world’s teeming middle class—be they smartphone-tethered sports fans or turkey-leg-toting vacationers—with technology.

DISb-01.15

Nowhere, perhaps, is this strategy more evident than at the company’s sprawling Florida theme park. Sitting on 40 square miles of former swampland in Orlando, the Walt Disney World Resort draws an estimated 19 million visitors a year. These days many are sporting brightly colored wristbands (blue and pink are the most popular; purple, which isn’t yet available, is the most requested). When they enter the park, they tap the bracelet against a sleek, Mickey Mouse–shaped terminal, which automatically lights up. Same goes for entering their hotel room at any of Disney World’s 26 on-site resorts, or paying for princess hats and jumbo churros at stores and kiosks throughout the park.

While many corporations are still waiting to see what the “killer app” for wearables is, Disney invented one. The company launched the RFID-enabled MagicBands just over a year ago. Since then, they’ve given out more than 9 million of them. Disney says 75% of MagicBand users engage with the “experience”—a website called MyMagic+—before their visit to the park. Online, they can connect their wristband to a credit card, book fast passes (which let you reserve up to three rides without having to wait in line), and even order food ahead of time.

Unlike putting up a new ride, the wearables initiative was a gradual, more iterative process. More than 28,000 door locks throughout Disney World’s resorts had to be changed. Hundreds of access points had to be configured across the park to enable wireless communication with the devices.

Disney’s executives emphasize that no personal information is actually stored on the device and that, contrary to what many people assume, the bracelets aren’t currently used to track lost children at the park. But Disney is only beginning to discover what MagicBands can do to bring richer customer data to the company—starting with the straightforward fact that it can now better track visitors’ purchasing habits.

Already, Disney says, MagicBands have led to increased spending at the park. And the plan is to expand to other locations, including the company’s line of cruise ships. In the meantime, Iger has greenlighted all manner of techie projects at Disney World, from interactive gaming tables at the lines for roller coasters (so customers can do something other than fume about the wait time) to new gut-shaking gizmos in the coasters themselves.

“It was Walt Disney who said, ‘Disneyland will never be finished as long as there’s imagination left in the world,’ ” says Tom Staggs, president of Disney’s parks and resorts division. “I think people will interpret that as we will always be building new attractions, but I think it should be interpreted much more broadly. This thing has to continue to evolve.”

Staggs, 54, is one of a handful of executives rumored to be in line for the CEO gig when Iger steps down three years from now. In 2009, Iger asked Staggs, then the CFO, to swap jobs with Jay Rasulo, the former president of parks and resorts. (Another rumored former candidate for the top job, ex-head of ABC Anne Sweeney, will leave the company this month.)

Back at the Dish in Burbank, Staggs and Rasulo are watching Iger interact with a new three-dimensional scene—a replica of the massive “Enchanted Storybook” castle currently under construction at the company’s upcoming park in Shanghai. The new castle, which will feature a built-in stage and an underground boat ride, seems a fantastical accomplishment, even for Disney’s Imagineers. But it wouldn’t be the first time the 92-year-old company captures the imagination of millions by bringing “magic” to life.

As the CEO surveys the pointy towers and gilded hallways of the virtual construction, the words of Lasseter, Pixar’s co-founder and chief creative officer, come to mind: “Art challenges technology, and technology inspires art.” With the rapid changes both inside and outside Disney, maintaining the equilibrium of those two synergistic forces seems more relevant than ever. And Iger, straight-faced though he is, seems to relish perfecting the balance. 

This story is from the January 2015 issue of Fortune. An earlier version of this story stated that Line, a Japanese company, developed the Tsum Tsum line of plush toys and mobile game for Disney. Line developed only the Tsum Tsum mobile game.