While there has been a small village on Chao Phraya River since the early 15th century, the city of Bangkok was officially founded as the country's capital in 1782 by King Rama I. Since then, the history, culture and language of the city have gone hand in hand with that of Thailand as a whole.
Foundation of Bangkok
A bit of background knowledge: Thailand as we know it today was settled by the "Tai" people of southern China from around the 10th century onwards, and the small villages of farmers, hunters and traders developed into city-states ruled by different empires, including the Khmer (Camobdia), the Srivijaya (Malay) and the Mon-Dvaravati (Myanmar).
These empires started to decline as a national Thai identity began to develop, and by the 13th century the different cities had united into three main kingdoms with localised power and military strength. These were the Lanna Kingdom, located in northern Thailand; Sukhothai in the central plans; and Ayuthaya, towards the south.
The Ayuthaya Kingdom ended up being the most important, surviving over four centuries until 1767. It was wealthy thanks to international trade - and it was these interactions with westerners, most probably the Portuguese, that gave the country its former name: Siam.
When in 1767 the Kingdom of Ayuthaya was finally defeated by invading Burmese armies, Siam made a surprisingly quick recovery thanks to the leadership of Taksin the Great. Crowned King in 1768, Taksin established a new capital at Thonburi, on the west bank of the Chao Phraya River. The new King's greatness did not last long however, and he ended up going mad. Taksin was succeeded by a general who would become known as Rama I, who, in 1782, founded his capital in the area we now call Bangkok. Thonburi would remain its own separate province - and Thailand's second largest city - until 1971, when it merged with Bangkok to become a district of the capital.
Development of Bangkok
During the reign of Rama I, Bangkok's magnificent Grand Palace and Wat Pho temple were built. His successors built yet more wats, or temples, including Wat Arun as well as schools, libraries and hospitals. Bangkok, and therefore Siam, like much of the rest of the world, was industrialising and modernising; with both political and infrastructure reforms. Originally relying on canals as the main way to travel through the city, by the late 19th century there were roads, bridges, the first trains, and even an electric tram service.
While architecture was influenced by European styles, interestingly Bangkok, and Siam as a whole, were never colonised by the European powers. They were relatively safe due to their centralised power and as the rivalling French and British saw them as a neutral bridge between Indochina (France) and India and Burma (Britain). Having said this, disputes with the French did lead to Siam conceding some territory to the western power.
Revolution & World War II
The Rattanakosin Kingdom as established by King Rama I ruled over Siam until the revolution of 1932. Reflecting the social and political discourse seen around the world, this coup d'état - which was almost completely bloodless - ended the absolute monarchy, brought in Siam's first political party and established a constitutional monarchy. The current royals are still technically Rattanakosin kings and queens.
After adopting a neutral position during the Second World War, Thailand joined forces with Japan after they invaded in 1941, and as a result Bangkok was bombed by the Allies on several occasions between 1941 and 1945. Following the end of the war, Thailand signed a peace treaty with the US and were promised protection during the later Vietnam War.
The postwar period saw rapid growth, modernisation and westernisation in Bangkok and consequently across the rest of the country. Such quick development does not come without its issues. however, and problems with transportation, communication, housing, water supply and drainage, and pollution became prevalent.
Tourism boom & crises
Civil unrest due to these issues led to the 1973 popular uprising, and the years that followed would be marked by political instability and the conflicting presence of leftist student movements and ultra-right groups who feared a Communist takeover. After students were massacred by these groups in 1976, and following several coups, a more moderate party came into power in 1978, and by 1988 Thailand had its first Prime Minister.
Tourism in Thailand became popular amongst the US military during the Vietnam War, and with an economic boom in the 1980s - despite a financial crisis that hit Asia in the late 1990s - Bangkok has continued to be one of Asia's most important tourist and commericial cities.
Despite this, Bangkok and Thailand have not been without issues. There have been a number of protests and coups over the past few decades, and in 2014 democracy was replaced with "National Harmony" - basically the country is led by a military dictatorship. There have been increasing restrictions on freedom of speech and assembly since then and insulting the monarchy is strictly forbidden.
It remains a regional power in Southeast Asia and thanks to the money brought in by tourism, as well as its manufacturing industries and ever-present agriculture, is continuously developing. There's no reason to believe Bangkok won't make it to the most-visited city in the world yet again.