A gene is the fundamental unit of heredity that carries genetic information from one generation to the next, coding for specific traits.