Jousting started in the middle ages when Calvary (mounted soldiers) were the most deadly form of weapon. It was originally a form of practice for war. Jousting progressed into it's own sport, where wealthy landowners (who generally trained and supplied knights for the King) would challenge each others knights. In some cases, a jouster may challenge another even though they did not fight for a specific person already, in which case they would auction themselves off to the highest bidder in order to compete, and to make a living.
By the 14th century, nobility and royalty had begun to compete at jousting as well. King Henry VIII was badly injured jousting (permanently ending his jousting career), and Henry II was killed participating in the sport.
In the 16th century, with the invention of firearms, jousting begun to lose it's popularity. Sometime during the 17th century, Jousting had all but disappeared as a sport. Only traces of the once popular competitions could be found, and generally only in Europe.
Today, several historical societies and entertainment venues recreate jousting competitions to provide a glance into history, as well as to provide entertainment for spectators.