Genetics is the branch of biology that studies genes, genetic variation, and heredity in organisms. It explains how traits are passed from parents to offspring through DNA. Neurology deals with the nervous system, while ecology focuses on organisms and their environment.