P-value in Pathway analysis for data with two groups

Hi
I’m struggling to understand the p-value from enrichment analysis that are done while running pathway analysis in MetaboAnalyst. What significance does these values represent? Especially, when you upload the data for metabolite concentrations for two groups, what these p-values are? Are these the comparison between two groups e.g., a given pathway significant in one group compared to the other? If yes, how the software decide reference group? Please elaborate so I can understand this part. Thank you in advance.