The court has no power over Parliament. The principle of "Parliamentary Privilege" is well established, and there have be a number of high profile cases in which Judges have ruled that they can take no action against some alleged wrong (such a libel or breaking an injunction) because the wrong occurred in Parliament.
Moreover there is no Judicial review of the Queen's reserve powers. The authority of the courts to pass judgement flows from the supremacy of the monarch. I know of no case in which the courts have been asked to review an act of the Crown. Purely personal decision, such as "who to make a Knight of the Garter" are the private decision of the Queen and she cannot be questioned.
However the advice given to the monarch by her advisers is potentially subject to judicial review. For example, in 1984 the government used the royal prerogative to ban trade unions at GCHQ (the UK's surveillance agency). The courts ruled that this was subject to judicial review. While the actions of the Queen cannot be questioned, the advice given (in the form of orders in council) can be.
Further precedent exists in a case in which the royal prerogative was used to create a compensation scheme for injured firefighters. The courts ruled that this "frustrated the will of parliament", which had passed legislation that created a more generous scheme. Similarly, the courts ruled that withdrawal from a treaty (specifically the Treaties of EU by invoking article 50) would frustrate parliament by effectively nullifying the legislation passed by parliament to join the EU in 1972.
So royal prerogative and orders in council can be subject to review in the courts and can be overturned if they go too far in changing the constitution of the UK or undermine parliamentary sovereignty. The basis, as in other cases of Common Law is in precedent, statute and the interests of natural justice.
In principle, any Judge can rule on such a case (an in this instance the case is starting in Scotland as the high court in England was on holiday), but it is likely that weighty decisions like this will be appealed and end up in the Supreme Court.
Several of my examples are drawn from https://ukandeu.ac.uk/judicial-review-and-prorogation-a-legal-challenge-or-mere-political-bluster/