Many people who get into PhD programs have some level of undergraduate research (typically performed in a lab, alongside grad students and a professor). When a graduate acceptance committee is evaluating applications, signals like "I have worked with a professor", "wrote an undergrad thesis", and "was coauthor and published in a peer-reviewed journal" cause applicants to be ranked more highly than peers who lack those signals.