Stock price prediction is a significant area of research in finance that has been ongoing for a long time. Several mathematical models have been utilized in this field to predict stock prices. However, recently, machine learning techniques have demonstrated remarkable performance in stock price prediction. Moreover, XAI (explainable artificial intelligence) methodologies have been developed, which are models capable of interpreting the results of machine learning algorithms. This study utilizes machine learning to predict stock prices and uses XAI methodologies to investigate the factors that influence this prediction. Specifically, we investigated the relationship between the public’s interest in artists affiliated with four K-Pop entertainment companies (HYBE, SM, JYP, and YG). We used the Naver Keyword Trend and Google Trend index data for the companies and their representative artists to measure local and global interest. Furthermore, we employed the SHAP-XGBoost model to show how the local and global interest in each artist affects the companies’ stock prices. SHAP (SHapley Additive exPlanations) and XGBoost are models that show excellent results as XAI and machine learning methodologies, respectively. We found that SM, JYP, and YG are highly correlated, whereas HYBE is a major player in the industry. YG is influenced by variables from other companies, likely owing to HYBE being a major shareholder in YG’s subsidiary music distribution company. The influence of popular artists from each company was significant in predicting the companies’ stock prices. Additionally, the foreign ownership ratio of a company’s stocks affected the importance of Google Trend and Naver Trend indexes. For example, JYP and SM had relatively high foreign ownership ratios and were influenced more by Google Trend indexes, whereas HYBE and YG were influenced more by Naver Trend indexes. Finally, the trend indexes of artists in SM and HYBE had a positive correlation with stock prices, whereas those of YG and JYP had a negative correlation. This may be due to steady promotions and album releases from SM and HYBE artists, while YG and JYP suffered from negative publicity related to their artists and executives. Overall, this study suggests that public interest in K-Pop artists can have a significant impact on the financial performance of entertainment companies. Moreover, our approach offers valuable insights into the dynamics of the stock market, which makes it a promising technique for understanding and predicting the behavior of entertainment stocks.