Perhaps someone else can provide a more general and logical approach to prepositions, but I'll give you my take on the sentences you provided:
We have a few authors who are popular in philosophy
Notice that in this, "popular" is an adjective and "philosophy" is a noun.
"We have a few authors who are popular in philosophy." This is correct. This describes the context of the authors' popularity.
"For" in this context would be used to describe purpose. Philosophy
does not utilize popularity, so "for" makes no sense here.
"Of" would also not be used here. Using "of" in this example would
imply that the authors' popularity consists of philosophy, which does
not make sense. You can modify some adjectives with "of," but this doesn't work with
"popular." For example, you could say "The glass is full," but if you
wish to say that water fills the glass, you would say, "The glass is
full of water."
Your second example is a little more ambiguous because it is not a complete sentence. But notice that the words surrounding the blank space, "authors" and "philosophy," are both nouns. There are a couple options here:
"The most popular authors of philosophy" means that the popular authors' works are philosophical. In this case, "of" describes what kind of authors they are.
"The most popular authors in philosophy" means that the authors are popular within the subject of philosophy. The use of "in" does not necessarily describe what kind of authors they are, but it is strongly implied from the context.