What can cause a false positive on a pregnancy test?

I’m just curious because my aunt had one and I don’t know why they happen. Is it something to do with the test or is it user error like something you eat or do before taking it?