How to add content to pages using a plugin?
If you are able to place a hook tag in all templates then you could register a new template hook method in your plugin.

Twig:

{% hook 'my-custom-hook-name' %}


Your plugin:

Craft::$app-&gt;view-&gt;hook('my-custom-hook-name', function(array &amp;$context) {
    $context['foo'] = 'bar';
    return '&lt;p&gt;Hey!&lt;/p&gt;';
});


For injecting CSS or JS you would use 

\Craft::$app-&gt;getView()-&gt;registerCssFile("file.css");
\Craft::$app-&gt;getView()-&gt;registerJsFile("file.js");


If you can't modify the template files to place a hook tag there you could dynamically generate the markup in your JS file, depending on your use case.