Add CSS/JS to particular view?
but what does $variables contain?  


A couple of render arrays and some values that be used by twig template. Your best option is check de documentation for each preprocess function to see what are included in $variables. Docs link template_preprocess(&amp;$var) better explanation about preprocess functions and default list of template preprocess functions


  but how do I apply this to views or content types?  


For me the best option is your twig template file by including this line.

{{ attach_library('my_theme/my-library') }}


No matter how many times this will be 'attached' only one will be downloaded (or aggregate). And only will added if this particular template will be rendered.

More info about Twig debug is here