Understanding the structure and function of DNA and RNA is crucial for understanding how gel electrophoresis works.