Over time, jousting grew safer, but it was always a dangerous sport. The only difference from real combat was that each combatant was aiming at the others shield to minimize the risk. The horses would not be at full charge in the distance they had to move, unlike a battlefield. But even at half speed you're talking about a combined speed of around 30mph. Arms wavered, and the lance might hit the head, or leg, of one of the knights. A horse might stumble. Or if one of the jousters had a hidden grudge, they might "accidentally" aim for a lethal strike.
Through the middle ages the rules evolved. Dulled edges on the lances, lances designed to break under light pressure, improved armor all helped people survive. But accidents happened, and people were injured or died.
The biggest risks in tournaments occurred in the melee, which was an event that faded out of favor. In the melee, the knights were divided into two teams. The teams then went at each other as if they were in real battle. As fighters were injured or yielded, they left the field until only one team remained. In the melee, with the constant motion, real weapons, and adrenaline rush, it wasn't uncommon for people to be seriously injured.
Fights to the death were rare, and would require special permission from the person putting on the tournament. Liege lords didn't like their vassals killing each other off, at least not outside an approved war. But sometimes it was easier to allow two knights or nobles to fight to the death in a tournament than it was to risk a wider conflict between the two.