It has all the ingredients to make a classic National Enquirer tale: the world’s richest man, salacious leaked text messages, a feud between a press baron and the US president, pictures of a penis, private investigators, the Mueller inquiry, large sums of money, claims of foreign government involvement, accusations of dirty tricks, and an attempt to exert control over a prominent figure using compromising material.

But this time the Enquirer itself is the focus of the story. The boss of Amazon, Jeff Bezos, published an extraordinary public statement on Thursday, accusing the celebrity-driven tabloid of “extortion and blackmail”. The billionaire said the paper, which had already exposed his affair with a TV presenter, had threatened to publish more compromising material unless he publicly declared that its coverage was not “politically motivated or influenced by political forces”.

Bezos refused and his decision to go public has instead focused attention on the Enquirer and exactly why it was so keen to secure a such a statement. It also raises further questions about how the Enquirer obtained its material – amid suggestions from Bezos’s team that a government could have obtained the Amazon boss’s messages – in addition to scrutiny of the role the publication played in the election of Donald Trump.

The leaked Bezos emails give an insight into how the Enquirer operates and exerts power through its front pages, which for many years were produced from a Florida office a short drive from Trump’s Mar-a-Lago retreat. The weekly publication is better known for its predictions of doom for celebrities such as Cher and Jennifer Aniston, which it serves up through strategically placed newsstands at supermarket checkouts.

“It’s a death and divorce Hollywood scandal sheet,” says the writer Chris Lochery, who wrote a history of the Enquirer and its parent company American Media Inc, describing how it pioneered the modern celebrity tabloid format. “They push the first amendment to the greatest extent. It’s hard to call them fantasists but they have very unique sources that no one else seems to talk to.”

But in recent years, amid falling sales, the publication’s public fortunes have become increasingly entwined with Trump. American Media Inc has since 1999 been controlled by David Pecker, a longtime associate of the president who used to produce an in-house magazine for him called Trump Style.

Long before he ran for president, Trump – who has always been obsessed with tabloid coverage – was tweeting about Pecker’s impressive business ability while the latter was a regular guest at Trump’s properties. When the National Enquirer formally endorsed Trump in the 2016 general election, it ensured people standing in supermarket queues in key swing states saw countless pro-Trump stories on the magazine’s cover. There were also wild stories about Hillary Clinton (sample headline: “Hillary: Corrupt! Racist! Criminal!”) and speculation that the father of Trump’s rival Republican Ted Cruz had been involved in the assassination of JFK.

The extent of the relationship between Pecker and Trump was laid bare at the end of last year, when it was revealed that the National Enquirer had worked with Trump’s campaign to deploy the tabloid tactic of “catch and kill”, where publishers buy up the exclusive rights to an individual’s salacious story and then refuse to publish it. As part of a deal with prosecutors, Pecker admitted paying $150,000 (£115,000) to purchase the story of the Playboy model Karen McDougal’s alleged affair with Trump and keep it out of the media for political reasons during the 2016 general election.

Ronan Farrow, who has previously investigated links between Trump and the Enquirer, said he had faced similar “stop digging or we’ll ruin you” threats from American Media but continued regardless.

The publication’s pro-Trump stance is not entirely without reason, according to Lochery, who said the magazine’s coverage was shaped by constant analysis of what readers want to read, with stories written to fit this agenda. “They went big on Trump,” he said, “because that was the feedback they were hearing. It wasn’t exclusively to try to boost Trump’s profile in the minds of the electorate; it was mainly to deliver the kind of stories their readers wanted to hear, which was pro-Trump and anti-Hillary. Stories they weren’t getting from more established – or scrupulous – publications.”

Donald Trump is a big fan of the National Enquirer’s reporting. Photograph: Alex Brandon/AP

The National Enquirer only sells about 400,000 copies a week to an ageing audience, but it still grabs attention due to its willingness to push boundaries and touch material that others would not use.

At the same time Pecker has been expanding his media empire, cornering the market of US celebrity and gossip magazines with the purchases of Us Weekly and In Touch.

Recently, Pecker’s growing media group and its relations with Saudi Arabia, which have grown since Trump entered office and strengthened ties between Washington and Riyadh, have drawn particular interest.

When the crown prince, Mohammed bin Salman, visited the US for a three-week public relations blitz last April, American Media produced a glossy 97-page magazine promoting Saudi Arabia, which sold for $13.99 on shelves across the US. Both American Media and Saudi officials have denied that the kingdom paid for the publication of the magazine, a lobbying move which would have required registration under the Foreign Agents Registration Act.

However, the New York Times has reported that Pecker travelled to Riyadh to talk to Saudi investors about an acquisition bid for Time magazine and is seeking to expand in Saudi Arabia’s growing media and entertainment sector – claims denied by Pecker’s representative.

Bezos alleges that the National Enquirer is “particularly sensitive” about its relations to Saudi Arabia, pointing out that his ownership of the Washington Post has made him a target of anger for the kingdom after the murder of the Post columnist Jamal Khashoggi at the Saudi embassy in Istanbul.

The Amazon boss’s personal security adviser went further, briefing Washington Post reporters that he believed a “government entity” – potentially foreign – had played a role in obtaining the messages.

Regardless of the National Enquirer’s methods, there is one man who is a big fan of its reporting: Donald Trump.

“So sorry to hear the news about Jeff Bozo being taken down by a competitor whose reporting, I understand, is far more accurate than the reporting in his lobbyist newspaper, the Amazon Washington Post,” Trump tweeted last month when news of Bezos’s affair broke in the tabloid, before having a dig at the broadsheet newspaper.

“Hopefully the paper will soon be placed in better & more responsible hands!”