Gambling has a long and rich history. It's hard to answer exactly who the first gamblers were, because it seems like history of gambling starts, around as long as humans have lived in formed societies. There is evidence that history of gambling took place in China around 2300 B.C. It's the first recorded gambling and they used dices to decide about territory. Other ancient writings and findings on archaeological sites suggest that the earliest gambling could have predated that by thousands of years.
Many theories exist why gambling started to emerge. The most common theory is that it was related to predicting the future. In ancient times they had a strong belief in fate and that you for example could read everyday objects to get ideas what would happen the coming days or months. Often this was tied to religion. In time people started to gamble on these predictions, even when their own religion frowned upon it. All major cultures have had some forms of gambling, including ancient China, ancient Egypt and the Roman Empire.
Today when people hear the word gambling they think of casinos and modern casino games like blackjack, baccarat and roulette. Even the modern games have a long history of gambling. Around 1600 they played early versions of blackjack in Spain. Baccarat was played in Italy and France already around 1400, but didn't become a popular casino game until half a millennia later. Roulette has origins in France in the 18th century. Slot machines are a more recent phenomenon and were first developed in the United States in the 1890s. From the 1960s and onward most mechanical machines were replaced by electronic slots. The development continued and today there are video slots and advanced casino software that can run on a wide variety of electronic devices.
In the history of gambling it's also important to discuss the venues that were used to attract gamblers. In Europe the earliest venues that can be considered casinos go back to the 1600s in Italy. Venice needed to control the gambling environment during the carnival season. That paved the way for other casinos. One important casino was Homburg Casino that launched 1841 in Monte Carlo. United States was a bit behind, but that quickly started to change. In the late 19th century gambling was common in saloons. In 1931 gambling was legalized in the state of Nevada. That eventually lead to Las Vegas, which remains the main hub for gambling in US to this day.
Internet created many opportunities for gambling and it became a turning point in the history of gambling. Now gambling could move from physical casinos right into the comfort of your own home. It led to a boom for the gambling industry and the result was rapid expansion in the 1990s. Regulating online gambling was hard for governments. Many of the online casinos were registered in small countries abroad and could still operate globally. Online gambling continued to grow and today millions of players enjoy casino, sports betting and poker online.