A maths teacher once told me that if I'm struggling to work through a logical problem in my head, I should look at the extreme numbers, because that often gives a clearer picture of what's happening. This has helped me a lot, and is how I would approach this:
Let's say we've got a test that:
* If you've got cancer, detects it 100% of the time (to make the maths easy)
* If you haven't got cancer, gives you a (true) negative 99% of the time, and a (false) positive 1% of the time.
For starters, consider a population of 100 people, all of whom have cancer. Our magical test always finds these cases, so we have an 100% positive rate, and a 0% false positive rate. (None of these can be false positives because we know they all really do have cancer.)
Now consider a group of 200 people, 50% of whom have cancer, and 50% of whom don't. The group who have cancer will still all get detected, but if the 100 people who don't have cancer, one of them will be marked as having cancer even though they don't. In total, that's 101 people who will get a positive result. So our overall positivity rate is 101/200 (~50%), but our false positivity rate is the number of false positives divided by the number of all positives, so 1/101 (~1%)
Now consider the case where we have 101 people, of whom only one has cancer. If we run our test a third time, we of course detect the person with cancer, but of the remaining 100 who don't have cancer, we will detect a second person. That's two positive cases in 101 people, so our positivity rate is ~2%. However, of those two positive cases we know only one really has cancer - the false positivity rate is 1/2, or 50%.
So that's three situations where the only thing we've varied is the proportion of the population who have the condition we're scanning for. (Technically we also changed how big the population was in the first place but that was just to make the maths easier - it doesn't affect the results at all.) However, we get a different rate of false positives in every test, because the number of false positives is dependent on the ratio between the number of people with cancer and the number of people without.
It's also worth noting that this obviously doesn't just apply to cancer, but also other situations. Most relevant to us in the last couple of years is probably Covid tests - you might have seen over the summers some scepticism about how valuable it is to do lots and lots of tests, and that's because during those times, the number of affected people was lower, and so these tests were more likely to produce less useful results. However, in winter, even relatively poor tests become more useful, because there are more true positives, and therefore a lower rate of false positives.