Rendering issues
Google needs to render all client-side JavaScript to see all of your content. When this process fails, your content, no matter how awesome it is, goes invisible. And you lose your rankings.
Performance risks
JavaScript is the main reason why some websites are slow. By optimizing your JS usage, you can make your pages load faster both for your customers and for Googlebot.
Crawling & indexing
Unoptimized JavaScript can slow down the process of Google discovering and indexing your pages. And unindexed pages make all your SEO efforts essentially irrelevant.