A Systematic Investigation of Knowledge Retrieval and Selection for Retrieval Augmented Generation