An electrophoresis machine uses an electrical current to separate macromolecules like DNA, RNA, and proteins based on their size and electrical charge. Samples move through a gel matrix in a buffer-filled chamber, where smaller molecules travel faster and further than larger ones, allowing for accurate identification and analysis.