Google is caught up in a high-stakes lawsuit that could see the search engine giant reveal its long-guarded algorithm secrets.

As part of an on-going legal dispute the tech conglomerate has been given an ultimatum by a court in the UK, either withdraw evidence to its defence, or disclose details of its search algorithm. Not only would Google have to hand over the details of its algorithm, it would have to hand them over to a working SEO consultant.

For obvious reasons Google doesn’t want to give up this proprietary information, but what makes things even trickier is that Google also doesn’t want to withdraw the evidence, which is vital to the company winning the case.

The search engine giant also has a third option – Settle. But that could end up costing the company billions in damages. Not to mention the negative stigma associated with a settlement.

So just how did Google end up in this position?

Well, the whole shebang stems from a lawsuit filed against Google by a small vertical-search engine firm called Foundem. Foundem alleges it was the victim of anti-competitive practices and that the search engine deliberately ranked its own websites ahead of Foundem in search results.

Initially, Foundem was only available to a limited group of users before being opened up to everyone, though it still appeared quite prominently in search results.

But just two days after launching to everyone, the firm alleges it was buried in Google’s search results. Foundem dropped from the first page of search results to dozens and, sometimes, hundreds of pages below.

What makes this whole scenario suspicious is that Foundem’s search rankings only dropped in Google while it still ranked high on other search engines.

The firm is now demanding an SEO expert interprets the details of Google’s search algorithm. Google on the other hand argues that giving its algorithm information to an SEO would end up compromising the integrity of its ranking process.