The T790M mutation usually arises as a secondary mutation in patients who have been treated with first-generation or second-generation EGFR TKIs, such as erlotinib or gefitinib. Initially, these drugs effectively inhibit the mutated EGFR, but over time, cancer cells may acquire the T790M mutation, which reduces the binding affinity of TKIs to the EGFR, thereby leading to drug resistance.