I'll assume you are talking about tenure-track positions, due to the reference to an assistant professorship. If you are talking about postdocs, then it really depends on how your field works (e.g., how many such positions there are and how they are distributed among different types of universities).
It's certainly possible to get a job in a much higher-ranked department than the one you graduated from, but a little arithmetic shows that it's very unlikely, assuming departments in your field aren't growing dramatically.
Let's assume a steady state, in which departments are neither growing nor shrinking, and let's make the simplifying assumption that they are all the same size. Of course these assumptions aren't quite right, but they can generally serve as a first approximation.
What does it take to get a job at a comparable department to the one you graduated from? In a steady state, each professor will eventually be replaced by one new hire, but they will typically train multiple Ph.D. students. This means that there's just enough room to hire each professor's best student ever, over their whole career. Of course the hiring won't actually work out that way, since the top students are not uniformly distributed among professors (and there will also be competition from students who attended higher or lower-ranked schools). However, this sets a lower bound: if you aren't at least as good as the career-best student of a typical professor from a top X department, then you can't realistically expect to get a job at a top X department yourself.
Going up in the rankings is even harder. The number of people who are their advisor's career-best student at a top 200 department is ten times the total number of positions at top 20 departments. This means that 90% of them will fail to get such a job, since there just aren't enough positions to accommodate them. In practice, it's even worse than these numbers indicate (generally much worse), but the point is that simple arithmetic guarantees at least a 90% failure rate even for these highly successful students.
So you shouldn't be surprised that your friend failed to go up in the rankings by a factor of 10: that requires either exceptional luck or exceptional accomplishments.
What is taken under consideration when one makes such application?
It's really no different from any other application, with no special requirements or considerations. You need to make the case that you are a better choice than any other available candidate. Applicants from low-ranked department often face some initial skepticism, but hardly anyone would be silly enough to obsess over rankings while disregarding visibly superior accomplishments.