I am answering this in the case of a criminal jury trial (given the context of the previous question).
It is my understanding that the judge must accept (almost?) all
evidence admitted into court.
So, this leaves me with three questions:
What happens if an official shows evidence that the judge hadn't
agreed to feature in the trial? . . .
What happens if the evidence happens to be inadmissible?
A trial in a criminal case takes place in a courtroom at a predetermined date and time, with the prosecutor physically sitting at one table in front of a judge and the defendant and the defendant's lawyer physically sitting at another table in front of the judge, and a jury physically sitting in a seating area to the side of the judge, and a witness (usually) physically sitting in a chair on the other side of the judge (in rare circumstances, for minor witnesses, testimony is provided by telephone with the phone put on speaker in the courtroom for all to hear), and a court reporter or tape recorder keeping track of what happens verbatim.
In a trial, essentially all evidence comes in through witnesses sitting on a special the chair in front of the judge designated for witnesses (called the witness stand) at the request of either the prosecuting attorney, or the defense attorney.
This is the only way the evidence is introduced (other than by stipulations of both side's lawyers). Prosecutors and defense attorneys don't testify or provide evidence themselves.
The judge is usually not told what evidence will be offered at trial in advance, although sometimes a pre-trial hearing is held to consider a particularly important piece of evidence's admissibility prior to trial, in a hearing on what is called a "motion in limine" or a "motion to suppress". If that happens, the judge's decision made in advance will be honored by the judge when anyone tries to introduce the evidence at trial.
But those are the exception and not the rule. Usually, any witnesses can be asked any questions at trial and the judge does not consider the admissibility of the answer to the question until it is asked and objected to by the other side's lawyer at trial.
A defendant can choose to be, but is not required to be, a witness in his or her own case.
In a trial, when it is their turn, the prosecution and defense, respectively, ask witnesses to sit at the witness stand one by one and ask them questions, which the witness answers under oath, absent an evidence objection from the other side's attorney. While a witness is on the stand, exhibits such as documents or physical objects can also be introduced into evidence in connection with the authenticating testimony of the witness (except in cases where both sides stipulate to the admission of the documents or other non-testimonial evidence).
As the lawyers try to introduce evidence by asking a question to a witness on the stand, or by asking the judge for permission to introduce non-testimonial evidence, the other side's attorney can say, "I object". If that happens, the witness on the stand is not allowed to answer the question and the non-testimonial evidence (e.g. documents, or a knife allegedly used in a crime) is not made available to the jury until the judge rules on whether it is admissible or not in accordance with the rules of evidence.
Usually, the judge rules on the evidence objection immediately in the moment, although in rare cases, the judge will let the jury have a break for a few minutes while hearing arguments from the lawyers for both sides on about the relevant evidence rules and/or researching the legal issue, before ruling on the evidence issue. Once the judge rules on the evidence issue, the trial continues immediately.
If the judge "sustains" the objection to the evidence, then the question doesn't get asked and/or the jury doesn't get to see the non-testimonial evidence. The lawyer whose question or offer to introduce evidence was successfully objected to moves on to their next question (if any) for the witness instead.
If the judge "overrules" the objection to the evidence, then the witness answer the question and/or the jury gets to see the non-testimonial evidence which is "received" into evidence by the judge.
This process continues continuously, for as many business days as it takes, until all witness testimony and all non-testimonial evidence has been presented to the court and both sides have told the court that they have presented all of their evidence. Then each side makes closing arguments to the jury, the judge reads the jury instructions of law on how to resolve the case, and the jury is sent to closed room to discuss the case and decide whether to say "guilty" or "not guilty" with respect to each charge brought by the prosecution in the trial. This decision is called a "verdict" and when the jury has made up its mind on all charges present to it, the jury lets the judge know that it has made up its mind, and the judge calls everyone back to the courtroom, and the jury tells the judge what they decided in open court.
If the verdict is "not guilty" on all criminal charges in the case, then the case is over, with no post-trial motions and no appeals. If the verdict is "guilty" the defendant is convicted, subject to post-trial motions to declare a mistrial and appeals by the convicted defendant.
If the convicted defendant appeals the case, and the judge abused his discretion in overruling an objection to the evidence that is made by the lawyer for the defendant (or the defendant personally if the defendant is not represented by a lawyer), because no reasonable judge could have found that the evidence was admissible under the circumstances, then the appellate court rules that the judge has made an "error". The appellate court will not find that the judge's ruling is an "error" if the judge made the correct decision for the wrong reason.
If it is reasonably possible that "error" possibly in combination with other errors made by the trial court judge could have caused a convicted criminal defendant to have been acquitted by the jury if the errors weren't made by the judge, then the defendant gets a new trial.
The new trial usually before the same judge with a new jury. But the new trial is before a different judge and a new jury if the judge is no longer a judge on the court for any reason, or if the judge has been so defiant of the appellate court (typically ignoring its instructions in a retrial after a first appeal) that the appellate court decides it must remove the judge from the case.
A criminal defendant is only acquitted by an appellate court if the appellate court finds that it would be impossible under any circumstances for the defendant to be convicted in a new trial, possibly with different evidence presented by the prosecution.
What happens if a private citizen does the above?
This doesn't make sense. Private citizens don't rule on the admissibility of evidence in a criminal trial, and can't introduce evidence in a criminal trial except at the request of a prosecuting attorney or defendant's attorney by being called as a witness and asking the questions that the lawyers (and sometimes the judge as well) asks the witness.
Witnesses are not allowed to volunteer testimony or provide documents to a jury unless asked to do so by a lawyer in the case.
What happens if someone provides evidence in court without the
knowledge of the judge?
As the process described above should make clear, this is basically impossible absent some extremely irregular event on the same level of irregularity as someone bribing a jury or threatening a jury with harm if he votes the wrong way.