Power quality (PQ) plays an important role in ensuring the smooth operation of power systems. PQ disturbances may cause significant consequences, impacting the reliability and efficiency of power networks. This paper presents a comprehensive review of PQ within smart grids and the integration of renewable energy sources. Methods of detecting, classifying, optimizing, and mitigating PQ events are reviewed with providing a brief theoretical explanation for each technique. Related work done in the past two decades, was conducted, presenting a clear view of the development of research in a chronological order serving as a guide for future investigations in this field of study.