Recording sunnah was an Arabian tradition, and once people converted to Islam, they brought the tradition to the religion.
The Sunnah of Muhammad includes his specific words, habits, practices, and silent approvals. It is significant to the spirituality of Islam because it addresses ways of life dealing with friends, family, and government.
How far the hadith contributes to the sunnah is disputed, and highly dependent on the context. In the context of Islamic Law, Imam Malik and the Hanafi scholars are assumed to have differentiated between the sunna and the hadith. In some instances, for example, Imam Malik is supposed to have rejected hadiths that reached him because, according to him, they were against the "established practice of the people of Medinah". According to other opinions, sunnah consists of what Muhammad believed, implied or tacitly approved and was noted down by his companions in form of what is today known as hadith.
In Shi'a Islam, the word "Sunnah" means the deeds, sayings and approvals of Muhammad and the twelve Imams who Shi'a Muslims believe were chosen by Muhammad to lead the Ummah—the world Muslim community.
In the context of biographical records of Muhammad, sunnah indeed often stands synonymous to hadith as most of the personality traits of Muhammad are known through descriptions about him, his sayings and his actions, after becoming a prophet at the age of forty.