My entry into screenwriting was not smooth. When I was 20, I wrote a film on spec and sent it to the BBC. They wrote back: “Usually, when we reject submissions, we like to offer some encouragement, but in your case we don’t see any point in you continuing.” I took it as encouragement anyway, thinking that only people who write terrible things are capable of writing great things. And so I persevered. After that, 25 years passed before one of my screenplays got filmed.

I once interviewed Rick Senat, a veteran at Warner Bros. “You need to understand,” he said, “that no film ever gets made.” Given this essential truth, I think it’s worth trying to make sense of how I’ve now managed to be involved in two that were. What happened?

In October 2014, I received a message that Bong Joon-ho was staying in a hotel in Manhattan and wanted to talk to me about his next film. I met him and his producer, Dooho Choi, in the lobby. Film people can be quite ruthless and tough. I think it’s because the industry is filled with talented, driven people chasing nowhere near enough work. Film isn’t a meritocracy; there’s no system ensuring the best screenplays get produced. It’s a hustle. And so people can grow ambitious to the point of mayhem. But Bong and Dooho weren’t like that. They were quiet and introverted. I liked them right away.

They were fans of a film I had co-written with Peter Straughan a few years ago, Frank. It was inspired by my time playing keyboards for Frank Sidebottom, who wore a big, fake head and was possibly the strangest pop star in history. The film had been Peter’s idea. He liked the challenge of us writing about a man who hid under a fake head. The painted-on facial expression would never change, no matter what turmoil was going on underneath.

Strangest pop star in history … Maggie Gyllenhaal, Michael Fassbender and Domhnall Gleeson in Frank, co-written by Ronson. Photograph: Allstar

We worked with the director Lenny Abrahamson on Frank for several years, during which time Peter basically taught me how to write screenplays. “Films eat up ideas,” he said. You can have the greatest idea of your life – put it in a screenplay, it lasts about half a page, and you’ve still got 89.5 pages to go, every scene of which has to move the story forward. If you write something that is just a reiteration of a previous scene, the audience is outraged. And so on. He made the process seem less intimidatingly mysterious and more like journalism – a graft, with rules and boundaries.

Eventually, Peter declared Frank ready to be sent out into the world. “We only have one chance,” he kept telling me. He meant that a good screenplay is rarely enough to get a film made. There are a lot of great unproduced scripts out there, growing old and dying. So a financier always needs some other reason to get involved. Peter’s caution paid off. Michael Fassbender read Frank and liked the challenge. So that’s how Frank got made: an A-list actor became attached, attracted by the idea of playing someone wearing a big fake head.

Tilda Swinton and Seo-hyun Ahn in Okja. Photograph: Allstar/Netflix

Bong told me he’d written a first draft of a film. He was quite guarded. For some years, he said, his idea had remained a secret between him, Dooho, Tilda Swinton and her partner, the artist Sandro Kopp. But now he wanted an English-speaking writer to collaborate on subsequent drafts.

Bong asked me about writing Frank. I told him that Peter did the big brushstrokes and I filled in the details. Then the meeting ended and I went home, cursing myself. What if Bong had wanted a big-brushstroke person? It wasn’t even true. Peter and I had done everything together. Why was I always so self-defeating? Then Bong offered me the job. He had, it turned out, wanted someone who could fill in the details.

His first draft of Okja arrived. (There are spoilers from now on.) It was about a little girl called Mija, whose best friend, Okja, is a giant miracle pig “even larger than a rhinoceros or a hippopotamus. She looks silly, the oversized creature, awesome in size but slow and doesn’t appear very intelligent.” The two have grown up together in the Korean mountains, but now Okja is about to be seized by her owners – the Mirando Corporation, a kind of parallel-universe Monsanto. Mija has to rescue her friend before she’s turned into a new type of meat: “A superfood to reign over all superfoods.”

Bong’s script was enchanting and unsettling, like Spirited Away. There were great, mad chase sequences – “PEDESTRIANS scream and scatter at the sight of the giant pig” – and sudden tonal lurches into horror, like the moment Mija catches up with Okja just as she’s getting steered into some kind of industrial building. “Don’t go inside!” Mija yells. And then: “INTERIOR – SLAUGHTERHOUSE – NIGHT.”

As I read it, I felt anxious. The things I loved most about it were the same things a financier might recoil from. This film would need a big budget. It was a lot of fun but then it turned very dark. It was in essence a popcorn movie about cognitive dissonance, one of my favourite subjects. To eat the meat, we need to ignore the slaughterhouse. To behave cruelly, we have to trick ourselves into believing we aren’t. Plus, half of it was in Korean. Was Okja destined for a slew of dispiriting compromises? Would it get financed at all?

Bong’s draft felt perfect, except for one thing. Given that English wasn’t his first language, the English-speaking characters seemed stilted, like outlines of humans. That’s what he wanted me to work on. I got started. His script began with a great six-page set piece – a press conference during which Lucy Mirando (played by Tilda) unveils to the world the existence of her miracle pigs: “Accelerated growth, vastly increased size, high reproduction rate.” But who was Lucy? “Her movements are fluid and flawless,” Bong had written, “like that of a figure skater.”

It triggered a memory. In 2012, I went to the TED conference in California. One speaker was Regina Dugan, the head of Darpa, the US military department that creates experimental weapons. She walked out on stage wearing a black turtleneck, like Steve Jobs. Her first words were: “You should be nice to nerds.”

Then she produced a “hummingbird drone”. It floated above the heads of the tech entrepreneurs, who stared up in awe. “It’s beautiful, isn’t it?” she said. She was making the audience gasp in wonder at a drone in the shape of a hummingbird that was built to kill people. So I reworked Lucy in accordance with my memory of Regina Dugan: graceful and involved in the business of death.

Next, I moved on to the Animal Liberation Front, the group Mija teams up with to rescue Okja. Other films have, somewhat annoyingly, portrayed the ALF as entirely saintly and awesome. Too much awesomeness can be cloying. Bong’s ALF were much more fun. He had them heroic but forever bickering, like the Three Stooges. So I took this idea further. I gave one member a mental disorder born from a surfeit of moral goodness. I had him so obsessed with leaving a minimal ecological footprint, he’d given up eating altogether:

Mija: “What about tomatoes?”

Silver: “Ripened with ethylene gas, transported by trucks.”

Red: “We’ve told Silver that if he doesn’t bulk himself up, he can’t come on our next mission.”

Silver looks sad.

Then there was the animal scientist Dr Whitman, the public face of Mirando. I renamed him Dr Johnny and modelled him on a childhood TV hero, Animal Magic’s Johnny Morris, mainly because I liked the idea of Jake Gyllenhaal cavorting with zoo animals: “A GORILLA throws straw in DR JOHNNY’s face. Dr Johnny laughs uproariously. Dr Johnny lies underneath an ELEPHANT, washing its underside. The elephant takes a shit on Dr Johnny’s face. Dr Johnny shrieks with laughter. Dr Johnny cuddles a panda.”

Given that the reputation of so many of Morris’s TV contemporaries (although thankfully not him) haven’t stood the test of time, I made our Dr Johnny a drunk and a predator. I wasn’t trying to overwhelm Bong’s script with my voice. That would have been disrespectful – and stupid – because it was already brilliant. Instead, I was trying to give him my best version of his voice.

I handed in the draft. It was well received. For the next six months, we made amendments by Skype. It was exciting to see Bong sharpen his ideas. At one point, he had me watch the ending of The Battle of Algiers. It’s a protest scene, a crowd of women letting out a defiant cacophony of singing and shouting. Bong wanted to re-create this with the giant animals trapped in the slaughterhouse – a bombardment of rebellious, futile cries.

I got an extraordinary email from Tilda, too. Halfway through the movie, the Mirando Corporation suffers a PR disaster. And so I’d had an embittered Lucy abandon her graceful Regina Dugan-like facade and instead go nuts in a conference room, screaming expletives at her executives. My scene wasn’t good. It wasn’t working.

Tilda’s email homed in on the problem in a manner that was at once fantastically abstract and totally precise: “Lucy has grown into a kind of brutal zone since the last time we saw her. I wonder if we wouldn’t be better seeing something less fixed and more neurotic, like her ‘altruistic’ self is still putting up a fight, but with weird scrambled effects. Like Dr Strangelove and his rogue arm. Lucy sounds so bitter in the conference room scene. I’m wondering what Tony Blair sounds like now. I bet he’s not bitter. I bet he still has some vestiges of that “charismatic verve”. Is he particularly solicitous to his cleaning lady? Does he obsessively pick up litter in the park? I like the idea of Lucy being like a badly wired gadget – not firing right and chillingly unpredictable, like Nero, or at least Nero as played by John Hurt in I, Claudius.”

A scene from Okja. Photograph: Barry Wetcher/Netflix

I’ve never been a fiction writer. But with Frank and Okja, I eventually reached a point where I could open my laptop and feel as if the characters were standing there, like holograms on the keypad, ready to be told what to do. Still, I worried that all this progress might be in vain. And the truth is, had Netflix not stepped in, I’m pretty sure Okja would never have been made. Who else would have financed a $60m movie that is as strange and disturbing (and multilingual) as this? Netflix knew that Bong is as popular in Korea as Steven Spielberg.

At the Cannes film festival in May, an argument raged about whether Okja should be seen on a big screen or a small screen. But I think Netflix and Amazon are offering freedom and resources to idiosyncratic voices in a manner that studios have rarely done for decades, not since the days of Bonnie and Clyde and The Deer Hunter. So I think the argument should have been: do you want films like Okja to exist or not?

• Okja launches 28 June on Netflix. It also has a limited theatrical release.