The Origin of samba music history in Brazil, which today can be seen in awe at the vibrant Brazilian carnivals, can be found in Angola, Africa, from where it was brought to Brazil with the slave trading in the interval 1600-1888.
The word Brazilian Samba comes from Quimbundo language (the language of the area that became Angola) as “semba” and can mean several things. One meaning is to pray, or invoke the spirits of the ancestors, or the Gods of African pantheon. Samba could also be a complaint, a cry, or something like "the blues". Still another meaning is something of a “navel bump” which depicts the intimacy and "invitation" to dance. Today the word can also be a verb in Brazil as in “sambar” which is to samba (To dance samba)
The origin of Samba music has a lot of similarities with Mambo and Salsa, which are undeniably linked to slavery and the religious traditions of West Africa.
Through the people of Africa, samba history evolved by singing, dancing and rhythms which had ties into rituals culture and religion. You also find the samba rhythms in Capoeira (Brazilian martial arts / dance) and the Candomble (Religion from Africa), which today are a part of Brazilian culture and Brazil religion.
As the west Africans were forced into slavery in the strange foreign land of Brazil, the origin of samba music was preserved in their religious traditions by making them part of their daily life. The governing forces demanded Christianity of their slaves and prohibited executions of worship to their orixá (their god / saint, protector and helper). To the African, dance and song is worship. So what the slaves did was to camouflage the ceremonies as parties with dancing.
The authorities weren't fooled that easily and even up until the early twentieth century, police often raided "suspect parties". The need for secrecy made it necessary to conceal the meaning of certain dances and songs from the uninitiated. At times, to the annoyance of the "tias" (Candomble priestess, means aunt in english), musicians revealed and at the same time preserved the secret rhythms by mixing them with more accepted musical forms.
Candomble and the mixing with other music gave rise to a series of dances in the twentieth century, among them the origin of Samba music. To adherents of Candomble, the word Samba, means to pray, to invoke your personal orixá (god).
With the abolition of Brazil slavery in 1888, came a greater mobility for the population of Bahia (The state in which the city of Salvador lies and which was the primary target of the slave traffic). Many fled south, using samba as a way to survive. Samba is believed to have spread to Rio some time after 1889. (source: Origins of Samba Music)