Each party in a lawsuit must tell all the other parties in a lawsuit what documents they possess or control that may be used to prove or disprove a material fact at the trial. Parties must describe the documents and make them available for the other side to examine.
In Supreme Court, document discovery is built into the rules. Once the parties exchange the initial documents (a Notice of Civil Claim and Response), the parties must exchange lists of documents that are subject to the discovery rules.
In Small Claims, document discovery is typically ordered by a judge at a Settlement Conference if the parties cannot settle their dispute at the Settlement Conference.
Document discovery can be very tricky and requires significant effort. Consult a lawyer when engaging in this process.