Sometimes the defendant admits their guilt of the offence but disputes some of the allegations made by the prosecution. For example in an assault case the defendant might say that she or he punched the victim once but the prosecution might be saying that the facts of the case are that the victim was punched five times and kicked twice. The facts on which the court is imposing a sentence must be clear.
Not all disputed facts will end up at a disputed facts hearing. Before the defendant enters their guilty plea they can negotiate with prosecution to determine if there can be an agreement as to the factual basis on which the defendant pleads guilty. This can be done either by the defendant themselves or through their lawyer. If the dispute can not be resolved through negotiations, then it will be decided at a disputed facts hearing.
If the case requires a disputed facts hearing then the case would be adjourned to a later date when the witnesses were available to give evidence. It is conducted in the same way as a trial except that the court no longer has to decide if the defendant is guilty (she or he having admitted this even on their own version of what happened) but simply what happened, a decision as to the facts of the case.