How does a book chapter in an edited volume compare to a peer reviewed paper?
Like a lot of things in academia, I think this will heavily depend on what discipline you're in. In computer science for example, while there's nothing wrong with a book chapter, a paper at a conference or in a journal is typically more valuable.

The reason normally given is that papers are peer reviewed (as compared to edited), so they are somehow more 'valid'.

Having said that, there's always myriad exceptions. Writing a whole book that everyone uses is much better than a few papers. Later in the career, book chapters perhaps gain value as they're a mark of respect and prestige (once you've already proven your research ability).

As a counter-point though, from my limited experience, it seems that book chapters are much more common in bioinformatics and operations research, and thus are viewed more highly.

Talk to fellow academics in your area, their opinion will be the best guide.