Microarrays function by hybridizing labeled DNA or RNA samples to complementary DNA probes on the array. The level of hybridization is measured, providing quantitative data on gene expression or the presence of specific genetic variants. This data is then analyzed to identify mutations or changes in gene expression that may be linked to diseases or conditions.