A z-test is a statistical method used to determine if there is a significant difference between the means of two groups, or between a sample mean and a known population mean, assuming that the data follows a normal distribution. It uses the standard normal distribution to calculate the z-score, which indicates how many standard deviations an element is from the mean. This method is commonly used when the sample size is large or the population standard deviation is known.