'riches' without any qualification does normally mean money - but by contrasting it with 'while' - you have to assume when reading it that 'riches' means non-monetary enrichment in the first part. It's a bit of a trick with words. In the second, they are saying - well actually - it's both (the 'normal' monetary kind, and the non-monetary one previously implied. I guess they are saying that friends also help you make money, which, based on the other saying 'it's not what you know, it's who you know', does make sense.