IT IS an epic story of warring factions in a strange and changing landscape, a tale of incursions and sieges, of plots and betrayals, of battlefield brilliance and of cunning with coin.

The sequence of doorstop fantasy novels that George R.R. Martin began with “A Game of Thrones”, and which HBO has now turned into a hit television show, provides the sort of immersive experience of an alien world that has always been popular among techies. But these days the escapism they offer may be tinged with an eldritch sense of recognition. Silicon Valley offers few dragons or direwolves, but Mr Martin’s tales of a world that has lost its king echoes the reality of today’s technology industry, where the battle lines between the four large companies seen as dominating the consumer internet—Google, Apple, Facebook and Amazon—are in furious flux. The death last year of Steve Jobs, Apple’s monarch, robbed the technology world of the nearest thing that it had to royalty. But even before Jobs’s passing, tension was growing between the great powers of the web generation as the onset of mobile computing upset the previous balance of power.

The tech industry has a history of bitter rivalries: IBM and Apple in the 1980s; Microsoft and Netscape in the 1990s. But the rivalries shaping the market today are even richer and more complicated, not least because they have a personal edge. Three of the big four are still run by men who made their billions as founder, or co-founder, of their empires—Amazon’s Jeff Bezos, Google’s Larry Page and Facebook’s Mark Zuckerberg. And although Jobs no longer rules Apple, he groomed Tim Cook, his successor as chief executive. “In the modern history of technology we have never seen such a highly engaged group of chief executives and founders,” says Mary Meeker, a partner at Kleiner Perkins Caufield & Byers, a venture-capital company.

Nor has the industry ever seen such young and feisty firms—Apple, the oldest of the quartet, was founded in 1976—with so much financial firepower. Each of the companies has developed a powerful business model. Google has turned search into a huge money-spinner by tying it to advertising. Facebook is in the process of doing something similar with the way people’s interests and relationships are revealed by their social networks. Amazon has made it cheap and easy to order physical goods and digital content online. And Apple has minted money by selling beautiful gadgets at premium prices.

This has let the companies pile cash into their war chests (see table). They will need them. All four grew up when computing was basically something done at a desk or on a laptop with the programs you had to hand. Now, as in Mr Martin’s realm of Westeros, where the reader is always being apocalyptically assured that “winter is coming”, their world is undergoing great change. The iron phone As the web becomes something that lives through and on the phone, and software something handled in a cloud, the clear lines that once defined territories and strategies are blurring. A mixture of threat and opportunity has the big four using their cash and acumen to strike out into other areas—sometimes into uninhabited lands, sometimes into places where some other firm is used to ruling the roost. And they are not the only ones involved in the fray. A host of start-up lordlings—such as Twitter in microblogging, or Square in mobile payments—seeks to carve out fiefs of their own, either with an eye to being bought out by the big four or becoming powers in their own right. And there is an ancient empire to contend with, too: Microsoft, which recently launched its first tablet computer, is trying hard to get back into the game, having been profitably preoccupied with PC software. But it is the battle between the big four that will have the greatest impact in future on the way people find information, consume content and purchase all kinds of stuff, and on who takes their money in return.

The battlefields on which the big four are fighting are, like most battlefields, messy and confusing. They are also numerous. Apple and Google are crossing swords in operating systems for smartphones and tablet computers; both firms and Amazon are butting heads in hardware; Google and Facebook have become sworn enemies in social networking; some of the other protagonists even have designs on e-commerce, which has long been Amazon’s stronghold.

They also have territories to defend. Take Google. Its search engine gives it a rich heartland. The company continues to pour money into refining the algorithms that power this engine. It has reinforced its defences by annexing other services that help find things, for instance by buying ITA Software, a firm that provides flight data and other travel information.

Search engines and siege engines

It will not be easy to wrest this profitable property from Google. But each of the other web giants would dearly love to carve out a chunk. Arguably the biggest threat comes from Apple. The two firms used to enjoy one of the cosiest relationships in the tech industry—so cosy, in fact, that the search firm’s then chief executive, Eric Schmidt, sat on Apple’s board from 2006 to 2009. Now they are locked in a conflict that is every bit as intense as one of Mr Martin’s, if slightly less well provided with incest, debauchery and parricide.

At its heart lies the competition between Apple’s iOS mobile operating system, which powers the iPhone and the iPad tablet computer, and Android, Google’s rival operating system, which is used by a host of manufacturers such as Samsung and HTC. Google snapped up the firm that created Android in 2005 as a strategic hedge; it was worried that its search engine and other services might be excluded from mobile devices owned by potential rivals. It has since turned the system into a formidable competitor to iOS. According to IDC, a market researcher, Android was the system of choice for three-quarters of the 181m smartphones shipped in the third quarter of 2012. Google claims it is activating 1.3m Android devices a day.

What Google portrayed as a smart way to keep options open looked to Apple like a declaration of war, one in which a furious Jobs said he intended to go “thermonuclear”. Apple’s Siri voice-activated personal assistant is part of the attack—a new sort of search engine that can serve up answers to people on the go. Apple’s controversial decision earlier this year to take Google Maps out of iOS and replace it with the company’s own, flawed mapping product is another attempt to provide ways of finding things that are Google independent.

Some experts think Amazon also poses a threat in this battle to find things. “Google used to be the toll-taker, directing people to Amazon,” says John Battelle, a seasoned Valley-watcher and the founder of Federated Media. “Now people are increasingly bypassing it and going straight to Amazon to find and buy stuff.” He has a point: Forrester, a research firm, reckons that 30% of America’s online shoppers begin their search for a product at Amazon. Facebook is also rumoured to be working on a search product with a social spin. Mr Zuckerberg recently said at a conference that, thanks to folk looking for friends and other things, the social network was handling “on the order of a billion queries a day already, and we’re basically not even trying.”

While Apple fights Google on one border, it fights Amazon on another, where the battle is to be the best provider of online content. After it launched the iPod, Apple mounted an unexpected raid into the realm of content with its iTunes digital music store. The content sold the hardware, and vice versa—a successful strategy that started a new rivalry with Amazon, which began as a bookstore in the mid-1990s but soon diversified, first into selling compact discs and DVDs, now into clothes, kitchenware and everything else. But last year 37% of Amazon’s $48 billion revenue still came from media, both physical and digital.

The most hard-fought battle between them so far has been in the e-book market. Amazon accounted for some two-thirds of all digital-book downloads in America last year. Apple accounted for just 5%, but it has been trying to woo publishers away from Amazon with an aggressive strategy that gives them more freedom to determine e-book prices than under Amazon’s terms. In digital music, the tables are reversed, with Amazon’s Cloud Player music service struggling to make a dent in iTunes’ huge market share. In video both firms are trying to make headway against Netflix, which has been turning itself from a DVD renter to a video streamer.

Content-maesters

Facebook and Google have so far committed fewer assets to this campaign, though both are aware of its importance. Facebook’s strategy has been to give other firms’ content a social spin. In some territories it has struck alliances with the likes of Netflix and Spotify, a music streaming company, so its users can share what they are listening to or watching on these services with their friends. Google’s YouTube business dominates the world of user-generated video, but the company has struggled to develop a compelling alternative to both Amazon’s digital fare and iTunes. In March it finally brought together its disparate offerings in music, e-books and other areas as part of a new online store, dubbed Google Play, in an effort to concentrate its forces. But Google’s attempts to move into new territories are not always as successful as Android has been. It has mounted various attacks on Facebook’s social stronghold, without notable success.

Among the things Google added to Play were the mobile apps formerly housed in its Android market. The other titans have been hawking their own app selections, too. This is crucial to the way they see their battles unfolding: as a fight between the various platforms with which they seek to provide the best mobile experience. Here there is a three-way fight between Apple, Amazon and Google, which have each developed rival combinations of mobile gadgets, operating systems and app stores. Apple, which first woke up to the power of such platforms when it combined the iPod with iTunes, has the high ground. Its margins on iPhones are so good that Asymco, a market-research firm, reckons the company accounted for 60% of the total profits made by the mobile-phone industry in the third quarter of 2012, even though it accounted for just 16% of phone shipments during that period. But Apple now finds itself competing with rivals that have radically different ways of making money. Amazon is flogging its Kindle e-readers and tablet computers, which use a modified version of Android, at pretty much what it costs to produce and sell them. Where Apple used iTunes to sell iPods, Amazon uses its tablets to sell everything else in the world. Stark realities

Google’s platform plans are less clearly defined. To begin with it was happy for Android phones and tablets all to be made by others, but in 2011 it decided to splash out $12.5 billion on Motorola Mobility, a handset-maker among other things. Google already markets its Google Nexus tablets, which are made by Asus and Samsung. And it has recently begun selling cheap notebooks using not Android but another of its operating systems, Chrome. Most analysts expect Google to churn out relatively cheap devices in the hope that buyers will use them to access its search and other services, thus seeing the ads on them.

And then there is the empire over the water. Microsoft, which in America is now number two in search after Google, has a willing (and desperate) vassal in Nokia, a phonemaker, and a new mobile operating system. Built into its recently launched Surface tablet, this gives it a shiny new platform of its own. Like the Targaryen family, which used to rule Westeros and now plots in exile to regain the crown, the company is desperate to regain its former glory.

Facebook has so far stayed neutral in this. But it is not a bystander in the competition to create the best possible digital shopping experience for consumers—another battle for which those platforms are being built. To win this one means taking turf from Amazon. Facebook Gifts is a new service in America which mines what the company knows about its users, their tastes and their friendships to encourage them to buy and send each other gifts at appropriate times, such as birthdays. To get it off the ground Facebook bought a gift-giving outfit called Karma and forged partnerships with over 100 companies, including Starbucks and Lindt, a chocolatier.

Google is experimenting with a service that would let folk find goods online, order them and have them delivered within a day for a modest fee. This seems similar to Amazon’s hugely successful “Prime” service, which costs $79 a year to join in America. Rather than try to replicate the e-commerce giant’s extensive network of warehouses, Google is looking for partnerships with shipping companies and retailers instead. But if it is serious about taking on Amazon, it may ultimately have to buy a logistics firm. At $69 billion UPS has a market value less than a third of Google’s; it is valued at less than twice the search giant’s cash pile.

Platforms are the weapons with which the warring factions seek to rule their own lands and conquer new ones. Patents are the weapons with which they try straightforwardly to hurt their rivals. Although some lawsuits have been launched by “trolls” who accumulate patents without actually making stuff, a number have been launched by one giant, or a company acting as its catspaw, against one of the others. Apple has been lobbing lawsuits around in the smartphone arena as if armed with a trebuchet. Google snapped up Motorola Mobility in large part to get its hands on the firm’s thousands of patents issued and pending, thus bulking up its own defences and accumulating ammunition to fling at the fortresses of the competition.

With the battlefields seeming to multiply every quarter—mobile wallets, cloud computing and who knows what else—picking out the strategic shifts over the tactical setbacks is hard. Today’s apparent failures may contain the seeds of future victories. Google+, Google’s latest attempt to lay siege to Facebook, has its flaws. Apple was woefully under-prepared for its assault on Google Maps. But if Google wants to progress in the social arena, and Apple in location-based services, they have to make bold bets, and in both cases they have at least gained some sort of beachhead. The challenge the firms face is to move beyond the initial disappointment cannily enough to turn the openings into successes.

No one looks likely to win quickly. “There will be a lot of trench warfare,” predicts Roelof Botha of Sequoia Capital, a venture investor. And that looks likely to be great news for consumers, who will be able to choose from an ever wider range of innovative and cheap (or free) technologies. Of course, as competition increases, firms might be tempted to lock down their heartlands more tightly—or to use foul means to attack those of others. This is bringing regulators out of their lairs. “You’re starting to see an empire-strikes-back moment amongst antitrust authorities,” says Adam Thierer, a researcher at George Mason University.

The Others

Watchdogs in Europe and America have been looking into accusations that Apple has colluded with some publishers to break Amazon’s grip on e-books. And they have been scrutinising Google too. Some companies, including ones with links to Microsoft, have accused the search firm of unfairly promoting its own services, such as Google+, in search results. They also claim that it uses content from competitors without permission, and that it has struck anti-competitive deals in search advertising. The firm is under fire for allegedly using smartphone patents to stifle competition. Google’s legions of lawyers have been battling these charges.

Their lordships Page, Cook, Zuckerberg and Bezos thus need to map a course for their respective firms through dangerous legal and regulatory territory. At the same time they have to avoid being distracted from fighting their rivals; the mad emperors of Microsoft lost a lot of ground by taking on the inhuman might of the Department of Justice. And the shareholders, hungry for returns in a moribund global economy, need to be kept happy.

A king who pulled all this off might claim the throne by right; but his chances of being more than first among equals, or of a lengthy reign, would be slim. As in Westeros, these battles and plots promise many more sequels and series.