The law does not limit the number of people who can attend a court session. Citizens who are over 18 years old, not drunk, and have proof of identity can participate in the hearing.
If the parties apply for a closed hearing, the hearing may be held closed. It can be seen from this that divorce cases are generally heard in public. However, if the parties apply for a closed trial, they can be heard in private, and the decision-making power lies with the People's Court.
The reason why the law stipulates that "if the parties apply for a non-public trial, the trial may be non-public" is because divorce cases have their own particularities. The trial may involve some personal privacy and emotional content that you do not want to make public. Therefore, if the parties apply for a closed hearing, the court will generally allow it.