Endonucleases function by recognizing specific sequences of nucleotides, known as recognition sites, and making cuts at these sites. This specific action is crucial for the repair of damaged DNA, as it allows for the removal of damaged or mismatched segments. Their ability to selectively target sequences makes them useful tools in genetic engineering and molecular biology.