Insurance claims data is collected through the billing process. When a patient receives medical services, healthcare providers submit claims to insurance companies for reimbursement. These claims include codes for diagnoses (ICD codes), procedures, and medications, along with demographic information about the patient. The data is then stored in large databases managed by insurance companies or third-party administrators.