Madhhab is an Arabic term that refers to an Islamic school of thought or religious jurisprudence (fiqh). In the first 150 years there were lots of schools, several of the Sahaba are credited with one, prominent became the schools of Damascus (often named Awza'iyya), of Kufa, of Basra and the school of Medina, which survived as the Maliki madhhab, while both Iraqi schools were consolidated into the Hanafi madhhab. Shafi'i, Hanbali, Zahiri and Jariri are later.
Shiite Islam has its own school of law, the Jafari, founded by the sixth Imam Ja'far as-Sadiq.
The four sunni schools are not generally regarded as distinct sects, as there has been great harmony amongst the scholars of the 4 schools throughout Islam's history.
Imam Abu Hanifa was the 'founder' of the Hanafi school, lived in modern-day Iraq, not long after the Prophet Muhammad's death. It is reported that Imam Abu Hanifa studied under Imam Jafar Sadiq.
Imam Malik was born shortly thereafter, living in the city of Medina. There are some reports that they did live at the same time and, although Malik was much younger, their mutual respect is well-known. In fact, one of Abu Hanifa's main students, on whose teaching a lot of the Hanafi school is based, studied from Imam Malik as well.
Imam Shafi'i was also taught by both Abu Hanifa's students and Imam Malik and his respect for both men is also well-documented.
Imam Ahmad ibn Hanbal studied with Imam Shafi'i, and consequently there are many similarities between the madhhabs.
Sunnis believe that all four schools have the correct guidance, and the differences lie not in the fundamentals of faith, but instead in finer judgements and jurisprudence, which are a result of the independent reasoning of the 4 imams and the scholars who followed them. Because their individual methodologies in interpretation and extraction from the primary sources were different, they came to different judgements on many matters. For example, there are subtle differences in the methods of prayer in the 4 schools, yet the difference is not such that separate prayers need to be held. In fact, a follower of any school can pray behind an Imam of another school without any confusion.