Where are you reading the documentation? There should always be a way to trace it back to the package— that said, I obviously haven't read all R documentation from all possible sources.
As for a better way to find the package you want, I don't think there's one tried and true method. There are CRAN Task Views for broad categories.
When you say "a particular function" do you mean you literally know the name of the function, or you have an idea of what you want to be able to do? If it's a particular function that you've seen used somewhere, your best bet is to go to the source of wherever that somewhere is— it's definitely a best-practice to include your libraries/packages for reproducibilty, and there are clashing function names (they could be using a function from one package and you find the same function in another).