The most common reason for a false negative is timing: hCG has not risen high enough yet. Dilute urine later in the day, or after drinking a lot of fluid, can also push a genuine result below the detection threshold.
False positives are uncommon but do occur — after a recent pregnancy or loss, after an hCG trigger injection used in fertility treatment, and rarely with certain medical conditions. Some medications containing hCG affect results; most common medications, including hormonal contraception and antibiotics, do not.
A very rare cause of a falsely negative-looking test at high hCG levels is the hook effect, where an extremely high hormone concentration saturates the test. Diluting the sample can reveal the positive.