What are the four separate parts of MEDICARE? What is the role of each of these parts? When and how did each of these parts come into existence?

What are the four separate parts of MEDICARE? What is the role of each of these parts? When and how did each of these parts come into existence?