How does a grappling fight work?
All grappling fights start with an upright phase (wrestling phase) where the aim is to take your opponent down onto the ground. Although uncommon in Brazilian jiu-jitsu (done with a gi / kimono), you can also choose to start the fight "from the knees" without doing the upright phase. It is the fighter's decision whether to kneel down to start the fight.
Once on the ground, the aim of the fight is to achieve a dominant position with control over your opponent. The aim of these positions is to get your opponent to submit. The more dominant the position, the more successful the submission hold is likely to be. For example, one of the characteristics of luta livre is that fighters aim to get their opponent to submit without first getting into a dominant position.
The fight stops automatically when one of the fighters taps out following a submission hold by their opponent. The fight can also end if the referee stops it because they think one of the fighters is at risk of serious injury.
The vast majority of fights take place with a set time. Once time is up, if neither opponent has tapped out (or the referee hasn't stopped the match), the winner is the one with the most points. Points are scored by getting into dominant positions (e.g. side control, full mount, back, etc.).
Grappling competitions are generally organised by level, age and weight category. There is often also an "absolute" division for all of the fighters from every weight category, which highlights one of the sport's main principles: "technique is more important than strength."