In drug delivery, nanoparticles can encapsulate molecules, protecting them from degradation and targeting their release to specific sites in the body. This enhances the efficacy and reduces the side effects of treatments.