Keywords
PrimeFaces is a 3rd-party toolkit for JavaServer Faces (JSF), with rich interactive web components and support utilities. This commercial toolkit is available free (but support and early access to fixes requires a paid licence). If you are going to use JavaServer Faces (JSF) on a real project you should almost certainly start with [tm:primefaces] (after familiarising yourself with JavaServer Faces (JSF)).
If you find something is a bit too fiddly with core JavaServer Faces (JSF) you'll find that 9 times out of 10 the answer is that PrimeFaces has already solved it for you! It also has a very active community and very dedicated fans and commercial clients.
It isn't JavaServer Faces VS JavaScript, it's JavaServer Faces PLUS JavaScript!
JavaScript addict says: "I know nothing about JavaServer Faces (JSF) or software architecture but I just know that my latest, greatest, client-side JavaScript framework is better ..."
JavaServer Faces (JSF) writes JavaScript (and HTML) for you! It employs a powerful and robust server-side "backing bean layer" in combination with a very elegant XML-based XHTML Facelets interface component composition and templating system that bridges cleanly to the client side. It integrates beautifully with enterprise technologies such as Contexts and Dependency Injection (CDI). And PrimeFaces even has integrations with popular JavaScript frameworks such as Angular and React!