Centralized data repositories work by integrating data from multiple sources such as electronic health records (EHRs), laboratory information systems, and pharmacy management systems. This data is then standardized and stored in a centralized database, which can be accessed by authorized healthcare professionals.