What are the main reasons postdoc applicants get rejected?
There are two big issues: competition and potentially poor fit. Either can knock you out. In some fields, at some times, the competition is fierce. Be happy (a bit) that you made the short list.
On the other side of the coin, it is possible that a candidate is seen as a poor fit for the position. This is more likely to happen early in the process unless it comes down to personal issues - arrogance, or indifference, or ...
Your materials can be fine and you can be fine, but someone else is just seen to be a better fit at the moment. Soldier on.
You may not need the rest of the advice, below, since you seem to be able to reach the shortlist, but for others, note that your written materials have to be positive/strong enough to move you from the "all applicants" pile into the "we should look at this person" pile. The second pile is very short and if you don't get into it at a quick reading, you are done. Once you are in the shortlist it becomes more of a personal and less of an institutional "game". If you know you are a marginal fit for a position, don't bother applying except in exceptional circumstances.
The job market for postdocs is such that most new PhDs will have to contact 50-odd people to get maybe 5 interviews and 2 offers. Unless you meet someone at a conference that you click with, job searches are the academic version of Tinder; it's just a numbers game. Your PhD advisor can set you up a bit, but unless they're some superstar it's mostly on you to keep swiping.
If you aren't even getting replies to emails, you should work on your approach - having your advisor email a rec letter at the same time as your initial email is something that I've seen work well. You should also not take being ignored personally - usually your email just falls off the first page of the inbox and is therefore gone forever. You can follow up after a couple days if you don't get a response.
If you got to the interview stage, you probably aren’t doing anything wrong. The reality of today’s job market is that employers have the advantage because there’s an oversupply of candidates; paring down a large list of applicants is difficult enough, discerning who should be a job in a final pool of 3 or 4 highly qualified applicant is a nightmare.
It’s always good to remember that people don’t hire CVs: they hire other people. This means there’s a human element that enters in the selection process, and at the end of the process this human element can rarely be controlled, lest you are obviously much more qualified than the competing candidates. Basically, it can come down to pure luck.
You might have been bested because the other candidate was a slightly better fit for that specific position, because the supervisor of this other candidate or a referee for this other candidate knows the person offering the position, because the person offering the position has historically had good candidates from the school of this other applicant, because this other candidate publishes in this or that journal that is favoured by the employer etc, i.e. a whole host of factors which have minimal weight until someone has to decide between two more or less equally qualified candidates. Maybe this other candidate had just one more citation than you did at the time of the decision.
You cannot change any of the above factors; it’s unlikely that people who get the positions do something really different. If it’s just bad luck then one can take solace in the fact that there usually is a very restricted number of candidates on the final shortlist, so that every time you make it to a shortlist you increase the chances of all these infinitesimal variations will go your way this one next time.