I'm terrified of not matching, so I'm planning on putting a prelim med spot at the bottom of my primary rank list. Is there any harm in this? (other than I have to do a prelim if I don't match) Does the match algorithm try to "make everyone happy" and may potentially go down to my prelim spot so someone else may get a spot? thanks
The program doesn't try to "make everyone happy" in the way you imply. If you listed an advanced spot first, and a program lists you highly enough, you will get that advanced spot. Doesn't matter that giving you your second/third/etc choice would give everybody "a" spot. So no, you won't get to your prelim spot just because you listed it. The rank looks at your choices independent of what's lower on your list. If you rank before getting down to that prelim spot on your list, it's done.
As the prior poster indicated, the only "harm" of listing prelim spots at the bottom of your list is that you will be ineligible to scramble for categorical spots, just advanced ones, if you match into your prelim. So you do this if you'd rather end up with at least one year of your choosing over the chance to scramble with a blank state. A lot of people consider a good prelim program in the hand more valuable than the scraps you might snag in the scramble, but others might want the option of shooting for something categorical if they aren't dead set on an advanced path.
I don't know that anyone can say which is a "better" strategy here, because so much depends on what programs and applicants fall through to the scramble. My gut is that fewer of the more desirable paths will fall through to the scramble this year, because I think it's going to be a competitive, very specialty/lifestyle oriented match, which historically high participation. But we'll see if I'm right when all the data is in. It also should be noted that views differ as to whether a prelim path this year is a good step toward matching or pre-matching into an advanced/categorical path for next year. Some people dead set on advanced programs might be better off not matching anywhere and spending the year doing more research. So the answer to whether listing prelims at the end of your list is going to be, "it depends".
But OP, the risk you suggest (of losing your top choice to make more people happy) doesn't occur in the match. There will be unhappy people and unfilled seats in the match. There is every year.