Cryptomatte or Viewlayers?

Perhaps I am misunderstanding something but it looks as if cryptomatte and viewlayers can both be used to separate out objects, edit them somehow and put everything back together, so:

When to use which?
Is there a difference in performance?