Radiotherapy works by damaging the DNA inside cancer cells, which prevents them from growing and dividing. While healthy cells can also be affected, they are generally better at repairing themselves than cancer cells. This selective damage helps to target and eliminate cancer cells while minimizing harm to healthy tissue.