As printed circuit boards (PCBs) continue to evolve in complexity and miniaturization, the demand for robust and efficient inspection techniques has become paramount in ensuring the quality and reliability of electronic devices. The application of machine learning and deep learning techniques has revolutionized PCB inspection in recent years, enabling the ability to automate and improve numerous elements of the process. In this paper, a comprehensive analysis is performed on the applications and challenges of artificial intelligence (AI), encompassing techniques of deep learning and machine learning, in the domain of PCB X-ray scrutiny. The main focus of this research centers around defect detection, identification of components and layers, deep learning algorithms for image reconstruction, as well as the identification of defects and features in advanced packaging. This study examines the current cutting-edge advancements in each of these areas, closely examining the existing methodologies and technologies employed. Furthermore, it delves into the limitations and challenges inherent in PCB X-ray inspection, such as the unavailability of data, computational demands, and the interpretability of models. In addition, this article offers prospective insights and presents promising avenues like application of generative adversarial networks and deep learning reconstruction methods for future exploration.