What causes positive pregnancy tests when you are not pregnant?

What cause positive pregnancy test but periods? Doctors telling me I’m also negative really confusing and disheartening, please?