After a month adrift on the ocean, two men have been found on a deserted island in the Pacific. How could anyone survive being at sea for so long?

Two sailors from Kiribati are recovering after spending more than a month drifting in a small boat in the South Pacific Ocean. The pair were eventually found on an isolated atoll on the southern fringes of the Marshall Islands, 500km (300 miles) from home.

For 33 days the men from Kiribati, a former British colony that straddles the Equator, defied a combination of mountainous waves, howling winds and strong ocean currents to emerge weak and hungry but alive at the end of an astonishing journey.

Little is known about how they survived but theirs is a story of true resilience.

For Bob Cooper, a veteran survival expert from Western Australia, escaping such dire circumstances depends on staying positive and calm - not easy when salvation seems so far away.

The answer Collect rainwater

Ration food

Avoid sunstroke

Staring at horizon eases seasickness

A daily routine

Strong mental attitude

He thinks the men were likely to have faced a "storm" of conflicting emotions, where panic and rational thought battled for supremacy.

"Often it is whichever wins determines whether you succeed or not in a survival situation. So one side of your brain is saying, 'Let's get out of here, let's get help, I'm going to die and never see my loved ones again,' and it goes into sorrow and even depression.

"That fight is going on with your logical side saying, 'We need water, warmth, shelter, signals and food.'"

Desperate measures like jumping over board and towing the boat to an island in the distance can kill you, he adds.

Any food must be rationed and a system set up for collecting rainwater in buckets or plastic sheeting, he says, and having a daily routine is essential.

Tale of survival Richard Van Pham was adrift for nearly four months off US west coast in 2002

He was picked up near Costa Rica (in boat above)

Survived on fish, birds and rain water

Used turtle meat to attract sea birds and then killed them

Innovation helps too. One way to avoid sunburn, for example, could be the use of cardboard boxes to fashion hats, and using awnings for shade. Staring at the horizon can stave off seasickness.

Experts agree that while sound planning and a clear mind are key ingredients, luck plays a decisive part too. One over-inquisitive nudge by a passing shark or a freak wave could sink all hope, while a slice of good fortune could make all the difference.

"If they have fishing gear they can start fishing, you can extract the fluid out of fish and drink that as a substitute for water," says Mr Cooper, who once survived a fire on a prawn trawler, which sank in "heavily shark-infested waters" off Port Hedland in Western Australia.

"I went down with this net around me and sharks thrashing around me. I didn't panic and managed to get out, and was hanging on to this upside-down boat for about four hours before someone saw the odd silhouette against the sunset," he recalls.

Even if you survive on a boat, the chances of being seen on a vast ocean are slim.

Humans are unbelievably adaptable as long as they can keep their head Nick Vroomans, Staying Alive Survival Services

Despite an international effort, the marooned islanders from Kiribati could not be found while they were still at sea, their boat a tiny speck on a gigantic moving mass.

A team in the US used computer modelling to predict the currents to try to estimate where the men might be, while Australia sent a C130 Hercules on a marathon mission to scour the Pacific.

"It searched for three days for these two men over a 5,000 sq km (1,900 sq mile) area but didn't find anything," says Malcolm Larsen from the Australian Maritime Safety Authority, which oversees 53 million sq km (20 million sq miles) of sea, including vast swathes of the Indian, Pacific and Southern Oceans. "It is very difficult to see a vessel in the water."

Eventually the sailors, aged 53 and 26, reached Namdrik, a tiny coral outpost in the Marshall Islands. Their incredible efforts have drawn praise from some of the best in the survival business.

"I've known of people who have been in a perfectly survivable situation who have basically thrown it away and given up for whatever reason, while other people have just persevered with very little knowledge but have been able to tough it out mentally, so the will to live is key to all of this," says Nick Vroomans, a former chief instructor of the Australian Defence Force combat survival training school in Townsville.

WHO, WHAT, WHY? A part of BBC News Magazine, Who, What, Why? aims to answer questions behind the headlines

These guys convinced themselves they could survive and weren't going out without a fight, says Mr Vroomans, who is the director of Queensland-based Staying Alive Survival Services.

Coastal communities that rely on abundant supplies of fish in the South Pacific must also accept the inherent dangers that a seafaring life brings.

In Kiribati, the search for another fisherman who went missing last week has been suspended. He was onboard a small boat with two friends, who went diving. When they returned to the surface their companion and his vessel had disappeared.

Reporting by Phil Mercer