Immunogenetics is a branch of medical genetics that explores the relationship between the immune system and genetics, focusing on how genetic variations affect immune responses and susceptibility to diseases. It plays a crucial role in understanding autoimmune diseases, vaccine development, and organ transplantation compatibility.