What the ratio means
Contrast is the difference in brightness between text and its background, from 1:1 (the same colour) to 21:1 (black on white). It is worked out from each colour's relative luminance, as the Web Content Accessibility Guidelines (WCAG 2.2) define it.
The levels
AA is the usual target and what most accessibility laws point to: 4.5:1 for normal text, and 3:1 for large text (24px, or 18.66px bold) and for icons, borders and other parts of a control. AAA is stricter: 7:1, or 4.5:1 for large text.
When it fails
The checker suggests the nearest text colour that passes AA, keeping the same hue and only making it lighter or darker, so the design changes as little as possible.
Questions
Does it handle transparent colours?
No; give the colour as it ends up on screen. For text over a photo, check against the lightest and darkest part of the photo behind it.
Where do I get the colour codes?
From your design tool, or pick them with the Color Picker.